[llvm-branch-commits] [clang] 6f69240 - [Concepts] Add missing TPA commit to requires expression parsing

Saar Raz via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Wed Feb 12 06:27:26 PST 2020


Author: Saar Raz
Date: 2020-02-12T16:27:14+02:00
New Revision: 6f692404a30d7f58b20d40f7a6ceaf826320b145

URL: https://github.com/llvm/llvm-project/commit/6f692404a30d7f58b20d40f7a6ceaf826320b145
DIFF: https://github.com/llvm/llvm-project/commit/6f692404a30d7f58b20d40f7a6ceaf826320b145.diff

LOG: [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 271e495399170d69627c1acd591c9298cb0b5b4b)

Added: 
    

Modified: 
    clang/lib/Parse/ParseExprCXX.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/Parse/ParseExprCXX.cpp b/clang/lib/Parse/ParseExprCXX.cpp
index 9f94e0dde3bd..17f81ec96c1f 100644
--- a/clang/lib/Parse/ParseExprCXX.cpp
+++ b/clang/lib/Parse/ParseExprCXX.cpp
@@ -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;
           }


        


More information about the llvm-branch-commits mailing list