diff options
author | Nick Lewycky <nicholas@mxc.ca> | 2014-06-23 22:57:51 +0000 |
---|---|---|
committer | Nick Lewycky <nicholas@mxc.ca> | 2014-06-23 22:57:51 +0000 |
commit | ee28b09421d031c938fe1526bcbbabdf0bf96c59 (patch) | |
tree | 2da435cd16920bf2f8273fee29cbd414cd98b7a8 /test | |
parent | 42988461bb266eb0359f136417498b44a9f786b6 (diff) | |
download | clang-ee28b09421d031c938fe1526bcbbabdf0bf96c59.tar.gz clang-ee28b09421d031c938fe1526bcbbabdf0bf96c59.tar.bz2 clang-ee28b09421d031c938fe1526bcbbabdf0bf96c59.tar.xz |
Propagate isAddressOfMember into typo correction so that we don't correct &qualified-id into &unqualified-id. Also make sure to set the naming class when we find the qualified-id in a different class than the nested name specifier specified so far. Fixes PR19681!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@211551 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/SemaCXX/typo-correction-pt2.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/SemaCXX/typo-correction-pt2.cpp b/test/SemaCXX/typo-correction-pt2.cpp index cdef7e7500..88a7073f99 100644 --- a/test/SemaCXX/typo-correction-pt2.cpp +++ b/test/SemaCXX/typo-correction-pt2.cpp @@ -287,3 +287,16 @@ void test() { if (p) // expected-error-re {{use of undeclared identifier 'p'{{$}}}} return; } + +namespace PR19681 { + struct TypoA {}; + struct TypoB { + void test(); + private: + template<typename T> void private_memfn(T); // expected-note{{declared here}} + }; + void TypoB::test() { + // FIXME: should suggest 'PR19681::TypoB::private_memfn' instead of '::PR19681::TypoB::private_memfn' + (void)static_cast<void(TypoB::*)(int)>(&TypoA::private_memfn); // expected-error{{no member named 'private_memfn' in 'PR19681::TypoA'; did you mean '::PR19681::TypoB::private_memfn'?}} + } +} |