Skip to content

Commit 551c94c

Browse files
committed
use trailing return type location
1 parent 4e07dd2 commit 551c94c

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

clang/lib/Sema/SemaType.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4894,10 +4894,7 @@ static TypeSourceInfo *GetFullTypeForDeclarator(TypeProcessingState &state,
48944894
SourceLocation Loc = D.getDeclSpec().getTypeSpecTypeLoc();
48954895
SourceRange SR = D.getDeclSpec().getSourceRange();
48964896
if (Loc.isInvalid()) {
4897-
TypeSourceInfo *TSI = nullptr;
4898-
S.GetTypeFromParser(FTI.getTrailingReturnType(), &TSI);
4899-
TypeLoc TSILoc = TSI->getTypeLoc();
4900-
Loc = TSILoc.getBeginLoc();
4897+
Loc = FTI.getTrailingReturnTypeLoc();
49014898
SR = D.getSourceRange();
49024899
}
49034900
S.Diag(Loc, diag::err_trailing_return_without_auto) << T << SR;

0 commit comments

Comments
 (0)