================
@@ -980,7 +980,7 @@ Decl *Parser::ParseStaticAssertDeclaration(SourceLocation 
&DeclEnd) {
     if (getLangOpts().CPlusPlus11) {
       for (unsigned I = 0;; ++I) {
         const Token &T = GetLookAheadToken(I);
-        if (T.is(tok::r_paren))
+        if (T.isOneOf(tok::r_paren, tok::semi, tok::eof))
----------------
cor3ntin wrote:

I agree with Aaron, this does not seem to be the right fix. 
The issue seems to be that `T.consumeClose()` return false on semicolon - It's 
weird but changing that is probably gonna hurt recovery in other places.

so the
```
if (T.consumeClose())
   return nullptr;
```

Fails to do its job - maybe we can check here `if(Tok.isNot(r_paren) || 
/*...*/`).
Not very elegant but better than anything that would involve change to Sema

For the diagnostic message in @AaronBallman's link, we could choose to display 
it only if `ParseConstantExpressionInExprEvalContext()` produces something 
valid.

https://github.com/llvm/llvm-project/pull/187859
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to