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
This commit is contained in:
Argyrios Kyrtzidis 2012-02-11 01:59:57 +00:00
parent d4a7c123f3
commit e378948c8a
1 changed files with 1 additions and 0 deletions

View File

@ -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());
}