]> granicus.if.org Git - clang/commitdiff
When determining whether the type is the current instantiation, strip
authorDouglas Gregor <dgregor@apple.com>
Fri, 15 Jan 2010 16:05:33 +0000 (16:05 +0000)
committerDouglas Gregor <dgregor@apple.com>
Fri, 15 Jan 2010 16:05:33 +0000 (16:05 +0000)
qualifiers. Fixes PR6021.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93513 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaCXXScopeSpec.cpp
test/SemaTemplate/member-template-access-expr.cpp

index 8594583ec3eff223cbbec9f3b301305a149d1a2e..6006bca4b0be4e1cb29f9b2e6c9d0e4b94906204 100644 (file)
@@ -30,9 +30,9 @@ getCurrentInstantiationOf(ASTContext &Context, DeclContext *CurContext,
   if (T.isNull())
     return 0;
   
-  T = Context.getCanonicalType(T);
+  T = Context.getCanonicalType(T).getUnqualifiedType();
   
-  for (DeclContext *Ctx = CurContext; Ctx; Ctx = Ctx->getParent()) {
+  for (DeclContext *Ctx = CurContext; Ctx; Ctx = Ctx->getLookupParent()) {
     // If we've hit a namespace or the global scope, then the
     // nested-name-specifier can't refer to the current instantiation.
     if (Ctx->isFileContext())
index 9edefe8b63e014461173be828108e0e76c373c11..ea17cdbb586477369353478b88988432c993db48 100644 (file)
@@ -103,3 +103,23 @@ struct X5 {
     this->f<T*>();
   }
 };
+
+namespace PR6021 {
+  template< class T1, class T2 >
+  class Outer
+  {
+  public: // Range operations
+    template< class X > X tmpl( const X* = 0 ) const;
+
+    struct Inner
+    {
+      const Outer& o;
+
+      template< class X >
+      operator X() const
+      {
+        return o.tmpl<X>();
+      }
+    };
+  };
+}