Skip to content

Commit 6f69240

Browse files
committed
[Concepts] Add missing TPA commit to requires expression parsing
If an error had occurred when annotating a scope spec during the tentative parse for a type-requirement, we would not revert nor commit the tentative parse, triggerring an assertion failure. Commit the TPA in this case and then do error recovery. (cherry picked from commit 271e495)
1 parent 9fbd4ab commit 6f69240

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

clang/lib/Parse/ParseExprCXX.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3476,6 +3476,7 @@ ExprResult Parser::ParseRequiresExpression() {
34763476
// We need to consume the typename to allow 'requires { typename a; }'
34773477
SourceLocation TypenameKWLoc = ConsumeToken();
34783478
if (TryAnnotateCXXScopeToken()) {
3479+
TPA.Commit();
34793480
SkipUntil(tok::semi, tok::r_brace, SkipUntilFlags::StopBeforeMatch);
34803481
break;
34813482
}

0 commit comments

Comments
 (0)