Commit 6f692404 authored by Saar Raz's avatar Saar Raz
Browse files

[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 271e4953)
parent 9fbd4ab3
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -3476,6 +3476,7 @@ ExprResult Parser::ParseRequiresExpression() {
          // We need to consume the typename to allow 'requires { typename a; }'
          SourceLocation TypenameKWLoc = ConsumeToken();
          if (TryAnnotateCXXScopeToken()) {
            TPA.Commit();
            SkipUntil(tok::semi, tok::r_brace, SkipUntilFlags::StopBeforeMatch);
            break;
          }