diff options
author | David Blaikie <dblaikie@gmail.com> | 2012-10-11 22:55:07 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2012-10-11 22:55:07 +0000 |
commit | c2ff8e125a1182631931ec42bc49f34a9481b8ca (patch) | |
tree | b4ab1d62cf4bb5328b19887b154eeaa5c1205d2c /clang/test/FixIt/fixit.cpp | |
parent | cdb8ef593b0f13b53e5a63af314328590fb79afc (diff) | |
download | bcm5719-llvm-c2ff8e125a1182631931ec42bc49f34a9481b8ca.tar.gz bcm5719-llvm-c2ff8e125a1182631931ec42bc49f34a9481b8ca.zip |
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.
llvm-svn: 165763
Diffstat (limited to 'clang/test/FixIt/fixit.cpp')
-rw-r--r-- | clang/test/FixIt/fixit.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/test/FixIt/fixit.cpp b/clang/test/FixIt/fixit.cpp index dc0b6c8f2a1..253abd0f4e8 100644 --- a/clang/test/FixIt/fixit.cpp +++ b/clang/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(); +}; |