]> granicus.if.org Git - clang/commitdiff
Yet more instantiation-location information. Fixes PR5336.
authorDouglas Gregor <dgregor@apple.com>
Thu, 29 Oct 2009 17:56:10 +0000 (17:56 +0000)
committerDouglas Gregor <dgregor@apple.com>
Thu, 29 Oct 2009 17:56:10 +0000 (17:56 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85516 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/TreeTransform.h
test/SemaTemplate/template-id-expr.cpp [new file with mode: 0644]

index 5b78375e56bd524de4bbd1d8ba9d04e6e8930353..cb7b69fc95d2d338581a1f0668eef0c0dabb405f 100644 (file)
@@ -4453,6 +4453,8 @@ TreeTransform<Derived>::TransformUnresolvedDeclRefExpr(
 template<typename Derived>
 Sema::OwningExprResult
 TreeTransform<Derived>::TransformTemplateIdRefExpr(TemplateIdRefExpr *E) {
+  TemporaryBase Rebase(*this, E->getTemplateNameLoc(), DeclarationName());
+  
   TemplateName Template
     = getDerived().TransformTemplateName(E->getTemplateName());
   if (Template.isNull())
diff --git a/test/SemaTemplate/template-id-expr.cpp b/test/SemaTemplate/template-id-expr.cpp
new file mode 100644 (file)
index 0000000..a0cbe44
--- /dev/null
@@ -0,0 +1,14 @@
+// RUN: clang-cc -fsyntax-only -verify %s
+
+// PR5336
+template<typename FromCl>
+struct isa_impl_cl {
+ template<class ToCl>
+ static void isa(const FromCl &Val) { }
+};
+
+template<class X, class Y>
+void isa(const Y &Val) {   return isa_impl_cl<Y>::template isa<X>(Val); }
+
+class Value;
+void f0(const Value &Val) { isa<Value>(Val); }