================
@@ -2379,6 +2382,11 @@ StmtResult Parser::ParseForStatement(SourceLocation 
*TrailingElseLoc,
       return StmtError();
     }
 
+    // attribute-specifier without attribute (`[[]]`) isn't in AST.
+    // `__declspec()` is only applied to declarations, so we can ignore it.
+    if (!isa<CompoundStmt>(Body.get()) || BodyStartsWithAttr)
----------------
AaronBallman wrote:

Possibly. The cases I was worried about for token lookahead also involved lexer 
stuff like
```
template for (int x : {1})
#pragma clang diagnostic ...
{}
```
and whether anything can usefully produce an annotation token before the 
compound statement.

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

Reply via email to