Fix regression in r168477. Use canonical decl when looking for base class
authorRichard Smith <richard-llvm@metafoo.co.uk>
Thu, 22 Nov 2012 00:40:54 +0000 (00:40 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Thu, 22 Nov 2012 00:40:54 +0000 (00:40 +0000)
specified as a qualified name.

llvm-svn: 168479

clang/lib/Sema/SemaExprMember.cpp
clang/test/CXX/temp/temp.res/temp.dep/p3.cpp

index 6bf5f2e..d12e68e 100644 (file)
@@ -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
index 576e310..583fb4b 100644 (file)
@@ -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();
+    }
+  };
 }