]> granicus.if.org Git - clang/commitdiff
When pushing a copy of the TypeLoc information for a dependent
authorDouglas Gregor <dgregor@apple.com>
Thu, 17 Jun 2010 16:03:49 +0000 (16:03 +0000)
committerDouglas Gregor <dgregor@apple.com>
Thu, 17 Jun 2010 16:03:49 +0000 (16:03 +0000)
template specialization type, copy the location information but use
the new type. Fixes PR7385.

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

lib/Sema/TreeTransform.h
test/SemaTemplate/nested-name-spec-template.cpp

index d2995778fc643b0afefe5f4e6b08dfa5856e0aab..910aadbdc83e4145bcf6a39f404520c6bc3d5f7f 100644 (file)
@@ -3387,7 +3387,8 @@ QualType TreeTransform<Derived>::
     NewTL.setKeywordLoc(TL.getKeywordLoc());
     NewTL.setQualifierRange(TL.getQualifierRange());
   } else {
-    TLB.pushFullCopy(TL);
+    TypeLoc NewTL(Result, TL.getOpaqueData());
+    TLB.pushFullCopy(NewTL);
   }
   return Result;
 }
index e1e7246bd7edc9d626f5cba216dcd86010bb9ed2..12ab48680915bbb10aca3566410f875eab77c17d 100644 (file)
@@ -72,3 +72,19 @@ namespace N1 {
 }
 
 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}}
+}