From 734bd6e25c349248634d1d0c5d7127c4868331b0 Mon Sep 17 00:00:00 2001 From: Argyrios Kyrtzidis Date: Sat, 11 Feb 2012 01:59:57 +0000 Subject: [PATCH] For class template implicit instantiation, also update its location to point to the pattern template that it came from, otherwise we had this situation: template struct S { }; template struct S { }; void f() { S s; // location of declaration "S" was of "S" not "S" } git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150290 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Sema/SemaTemplateInstantiate.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/Sema/SemaTemplateInstantiate.cpp b/lib/Sema/SemaTemplateInstantiate.cpp index 8abb6e149a..43aad09817 100644 --- a/lib/Sema/SemaTemplateInstantiate.cpp +++ b/lib/Sema/SemaTemplateInstantiate.cpp @@ -1863,6 +1863,7 @@ Sema::InstantiateClass(SourceLocation PointOfInstantiation, ActOnFinishDelayedMemberInitializers(Instantiation); if (TSK == TSK_ImplicitInstantiation) { + Instantiation->setLocation(Pattern->getLocation()); Instantiation->setLocStart(Pattern->getInnerLocStart()); Instantiation->setRBraceLoc(Pattern->getRBraceLoc()); } -- 2.50.1