Skip to content

Commit 12dcbf3

Browse files
committed
Fixed implicit instantiations source range.
llvm-svn: 144977
1 parent 46fb558 commit 12dcbf3

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

clang/lib/Sema/SemaTemplateInstantiate.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -1818,8 +1818,10 @@ Sema::InstantiateClass(SourceLocation PointOfInstantiation,
18181818
if (!FieldsWithMemberInitializers.empty())
18191819
ActOnFinishDelayedMemberInitializers(Instantiation);
18201820

1821-
if (TSK == TSK_ImplicitInstantiation)
1821+
if (TSK == TSK_ImplicitInstantiation) {
1822+
Instantiation->setLocStart(Pattern->getInnerLocStart());
18221823
Instantiation->setRBraceLoc(Pattern->getRBraceLoc());
1824+
}
18231825

18241826
if (Instantiation->isInvalidDecl())
18251827
Invalid = true;

clang/lib/Sema/SemaTemplateInstantiateDecl.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -2478,6 +2478,9 @@ void Sema::InstantiateFunctionDefinition(SourceLocation PointOfInstantiation,
24782478
if (Inst)
24792479
return;
24802480

2481+
// Copy the inner loc start from the pattern.
2482+
Function->setInnerLocStart(PatternDecl->getInnerLocStart());
2483+
24812484
// If we're performing recursive template instantiation, create our own
24822485
// queue of pending implicit instantiations that we will instantiate later,
24832486
// while we're still within our own instantiation context.

0 commit comments

Comments
 (0)