From e378948c8a426743f472ec12f48aea7504f7537a Mon Sep 17 00:00:00 2001 From: Argyrios Kyrtzidis Date: Sat, 11 Feb 2012 01:59:57 +0000 Subject: 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" } llvm-svn: 150290 --- clang/lib/Sema/SemaTemplateInstantiate.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'clang/lib/Sema/SemaTemplateInstantiate.cpp') diff --git a/clang/lib/Sema/SemaTemplateInstantiate.cpp b/clang/lib/Sema/SemaTemplateInstantiate.cpp index 8abb6e149a5..43aad098178 100644 --- a/clang/lib/Sema/SemaTemplateInstantiate.cpp +++ b/clang/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()); } -- cgit v1.2.3