[cfe-commits] r106224 - in /cfe/trunk: lib/Sema/TreeTransform.h test/SemaTemplate/nested-name-spec-template.cpp

Douglas Gregor dgregor at apple.com
Thu Jun 17 09:03:49 PDT 2010


Author: dgregor
Date: Thu Jun 17 11:03:49 2010
New Revision: 106224

URL: http://llvm.org/viewvc/llvm-project?rev=106224&view=rev
Log:
When pushing a copy of the TypeLoc information for a dependent
template specialization type, copy the location information but use
the new type. Fixes PR7385.

Modified:
    cfe/trunk/lib/Sema/TreeTransform.h
    cfe/trunk/test/SemaTemplate/nested-name-spec-template.cpp

Modified: cfe/trunk/lib/Sema/TreeTransform.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/TreeTransform.h?rev=106224&r1=106223&r2=106224&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/TreeTransform.h (original)
+++ cfe/trunk/lib/Sema/TreeTransform.h Thu Jun 17 11:03:49 2010
@@ -3387,7 +3387,8 @@
     NewTL.setKeywordLoc(TL.getKeywordLoc());
     NewTL.setQualifierRange(TL.getQualifierRange());
   } else {
-    TLB.pushFullCopy(TL);
+    TypeLoc NewTL(Result, TL.getOpaqueData());
+    TLB.pushFullCopy(NewTL);
   }
   return Result;
 }

Modified: cfe/trunk/test/SemaTemplate/nested-name-spec-template.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaTemplate/nested-name-spec-template.cpp?rev=106224&r1=106223&r2=106224&view=diff
==============================================================================
--- cfe/trunk/test/SemaTemplate/nested-name-spec-template.cpp (original)
+++ cfe/trunk/test/SemaTemplate/nested-name-spec-template.cpp Thu Jun 17 11:03:49 2010
@@ -72,3 +72,19 @@
 }
 
 template<typename T> T N1::f0() { }
+
+namespace PR7385 {
+  template< typename > struct has_xxx0
+  {
+    template< typename > struct has_xxx0_introspect
+    {
+      template< typename > struct has_xxx0_substitute ;
+      template< typename V > 
+      int int00( has_xxx0_substitute < typename V::template xxx< > > = 0 );
+    };
+    static const int value = has_xxx0_introspect<int>::value; // expected-error{{no member named 'value'}}
+    typedef int type;
+  };
+
+  has_xxx0<int>::type t; // expected-note{{instantiation of}}
+}





More information about the cfe-commits mailing list