[cfe-commits] r168479 - in /cfe/trunk: lib/Sema/SemaExprMember.cpp test/CXX/temp/temp.res/temp.dep/p3.cpp

Richard Smith richard-llvm at metafoo.co.uk
Wed Nov 21 16:40:55 PST 2012


Author: rsmith
Date: Wed Nov 21 18:40:54 2012
New Revision: 168479

URL: http://llvm.org/viewvc/llvm-project?rev=168479&view=rev
Log:
Fix regression in r168477. Use canonical decl when looking for base class
specified as a qualified name.

Modified:
    cfe/trunk/lib/Sema/SemaExprMember.cpp
    cfe/trunk/test/CXX/temp/temp.res/temp.dep/p3.cpp

Modified: cfe/trunk/lib/Sema/SemaExprMember.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExprMember.cpp?rev=168479&r1=168478&r2=168479&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaExprMember.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExprMember.cpp Wed Nov 21 18:40:54 2012
@@ -163,7 +163,7 @@
     // 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

Modified: cfe/trunk/test/CXX/temp/temp.res/temp.dep/p3.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CXX/temp/temp.res/temp.dep/p3.cpp?rev=168479&r1=168478&r2=168479&view=diff
==============================================================================
--- cfe/trunk/test/CXX/temp/temp.res/temp.dep/p3.cpp (original)
+++ cfe/trunk/test/CXX/temp/temp.res/temp.dep/p3.cpp Wed Nov 21 18:40:54 2012
@@ -77,4 +77,13 @@
   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();
+    }
+  };
 }





More information about the cfe-commits mailing list