diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2012-02-11 01:59:57 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2012-02-11 01:59:57 +0000 |
commit | 734bd6e25c349248634d1d0c5d7127c4868331b0 (patch) | |
tree | 4ce4a87ee8953cce7eaddda7092cd88c9171910d /lib/Sema/SemaTemplateInstantiate.cpp | |
parent | 41105ad37a2de9bccfcd8137ccfa869cc8345275 (diff) |
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>"
}
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150290 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaTemplateInstantiate.cpp')
-rw-r--r-- | lib/Sema/SemaTemplateInstantiate.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
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()); } |