Skip to content

Commit 42e371b

Browse files
author
Erich Keane
committed
[NFC][Concepts] Change the Source Range of Concepts ParamMatching
As came up in the discussion on https://reviews.llvm.org/rG12cb1cb3720de8d164196010123ce1a8901d8122 We were asserting because the attempt to print a note found that our source range for a immediately declared constraint (as a part of Parameter Mapping Substitution) wasn't in order. However, it doesn't really make sense to have the location of this be the whole list of template arguments, as that would result in the range being: bool func(std::thing<char*> auto foo) {} ^^^^^^^^^^^^^^^ Even if done correctly. Instead, this patch makes the range be just 'foo' in this case (or a pointer right after 'auto' if unnamed).
1 parent ae5efe9 commit 42e371b

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

clang/lib/Sema/SemaConcept.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1132,8 +1132,7 @@ substituteParameterMappings(Sema &S, NormalizedConstraint &N,
11321132
Sema::InstantiatingTemplate Inst(
11331133
S, ArgsAsWritten->arguments().front().getSourceRange().getBegin(),
11341134
Sema::InstantiatingTemplate::ParameterMappingSubstitution{}, Concept,
1135-
SourceRange(ArgsAsWritten->arguments()[0].getSourceRange().getBegin(),
1136-
ArgsAsWritten->arguments().back().getSourceRange().getEnd()));
1135+
ArgsAsWritten->arguments().front().getSourceRange());
11371136
if (S.SubstTemplateArguments(*Atomic.ParameterMapping, MLTAL, SubstArgs))
11381137
return true;
11391138

0 commit comments

Comments
 (0)