summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaTemplateInstantiate.cpp
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2012-02-11 01:59:57 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2012-02-11 01:59:57 +0000
commite378948c8a426743f472ec12f48aea7504f7537a (patch)
treebc89e6d2e1f91f204f7d0f1fda78337f1d557159 /clang/lib/Sema/SemaTemplateInstantiate.cpp
parentd4a7c123f3cbb3f3b03e703aa8c855f8f6ec43c2 (diff)
downloadbcm5719-llvm-e378948c8a426743f472ec12f48aea7504f7537a.tar.gz
bcm5719-llvm-e378948c8a426743f472ec12f48aea7504f7537a.zip
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 <typename T1, typename T2> struct S { }; template <typename T> struct S<T, int> { }; void f() { S<int, int> s; // location of declaration "S<int, int>" was of "S<T1, T2>" not "S<T, int>" } llvm-svn: 150290
Diffstat (limited to 'clang/lib/Sema/SemaTemplateInstantiate.cpp')
-rw-r--r--clang/lib/Sema/SemaTemplateInstantiate.cpp1
1 files changed, 1 insertions, 0 deletions
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());
}
OpenPOWER on IntegriCloud