diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-11-22 00:40:54 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-11-22 00:40:54 +0000 |
commit | 746619a5ace6dcbd0970e904b1ebda838064ec03 (patch) | |
tree | 1d4343ec505385ccec676e17d7f824be94035360 | |
parent | f62c690c55fb920f3ba0a4f6e6e259e2ae7ce297 (diff) |
Fix regression in r168477. Use canonical decl when looking for base class
specified as a qualified name.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168479 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Sema/SemaExprMember.cpp | 2 | ||||
-rw-r--r-- | test/CXX/temp/temp.res/temp.dep/p3.cpp | 9 |
2 files changed, 10 insertions, 1 deletions
diff --git a/lib/Sema/SemaExprMember.cpp b/lib/Sema/SemaExprMember.cpp index 6bf5f2e3a2..d12e68e2ac 100644 --- a/lib/Sema/SemaExprMember.cpp +++ b/lib/Sema/SemaExprMember.cpp @@ -163,7 +163,7 @@ static IMAKind ClassifyImplicitMemberAccess(Sema &SemaRef, // member name lookup, and it's sufficient to check that we have the naming // class as a base class. Classes.clear(); - Classes.insert(R.getNamingClass()); + Classes.insert(R.getNamingClass()->getCanonicalDecl()); } // If we can prove that the current context is unrelated to all the diff --git a/test/CXX/temp/temp.res/temp.dep/p3.cpp b/test/CXX/temp/temp.res/temp.dep/p3.cpp index 576e310985..583fb4b3cc 100644 --- a/test/CXX/temp/temp.res/temp.dep/p3.cpp +++ b/test/CXX/temp/temp.res/temp.dep/p3.cpp @@ -77,4 +77,13 @@ namespace PR14402 { template<> struct A<char>::E : A<char> {}; // 'cannot bind to a temporary' char &s = A<char>::F().g(); // expected-note {{in instantiation of}} + + struct X; + struct X { void f(); }; + struct X; + template<typename T> struct Y : X { + void g() { + X::f(); + } + }; } |