Commit 271e4953 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.
parent 81dbb6ae
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -3486,6 +3486,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;
          }