aboutsummaryrefslogtreecommitdiff
path: root/test/FixIt/fixit.cpp
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2012-10-11 22:55:07 +0000
committerDavid Blaikie <dblaikie@gmail.com>2012-10-11 22:55:07 +0000
commitabeadfb11fde148f15c2fd67015e8163609d5b68 (patch)
tree6cd6b61824c8e8b99b163823ffbb8ca5ea651461 /test/FixIt/fixit.cpp
parent80eed72ed850d4d5ce49ad2a2c0971f260d8327f (diff)
Provide a fixit when taking the address of an unqualified member function.
This only applies if the type has a name. (we could potentially do something crazy with decltype in C++11 to qualify members of unnamed types but that seems excessive) It might be nice to also suggest a fixit for "&this->i", "&foo->i", and "&foo.i" but those expressions produce 'bound' member functions that have a different AST representation & make error recovery a little trickier. Left as future work. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165763 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/FixIt/fixit.cpp')
-rw-r--r--test/FixIt/fixit.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/FixIt/fixit.cpp b/test/FixIt/fixit.cpp
index dc0b6c8f2a..253abd0f4e 100644
--- a/test/FixIt/fixit.cpp
+++ b/test/FixIt/fixit.cpp
@@ -292,3 +292,10 @@ namespace greatergreater {
//(void)(&t<S<int>>==p);
}
}
+
+class foo {
+ static void test() {
+ (void)&i; // expected-error{{must explicitly qualify name of member function when taking its address}}
+ }
+ int i();
+};