================
@@ -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)
----------------
cor3ntin wrote:
I mean, our logic could actually warn by checking the next token is `{` - that
cover all the cases, i think
https://eel.is/c++draft/stmt.block#nt: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