================
@@ -1909,19 +1909,11 @@ Sema::ConditionResult Parser::ParseCondition(StmtResult
*InitStmt,
return ParseCondition(nullptr, Loc, CK, MissingOK);
}
- if (Tok.is(tok::semi) && ParsedAttrs) {
+ if (Tok.is(tok::semi)) {
----------------
Sirraide wrote:
I believe we do still need to check if we parsed any attributes at all because
afaik this is invalid:
```c
if (; true) {} // ERROR
```
but this is ok:
```c
if ([[]]; true) {} // OK
```
However, this is a bit of an issue since both of these have the same AST
representation (they’re just `NullStmt`s)... I wonder if we could update
`ActOnAttributedStmt()` to _always_ create an `AttributedStmt` even if there
are no attributes in the _attribute-specifier-sequence_: We could add an
additional `bool AlwaysBuildAttributedStmt = false` parameter to
`ActOnAttributedStmt()` for this. Can you try and see if this approach works?
https://github.com/llvm/llvm-project/pull/198244
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits