================
@@ -276,6 +276,10 @@ def err_expected_while : Error<"expected 'while' in 
do/while loop">;
 
 def err_expected_semi_after_stmt : Error<"expected ';' after %0 statement">;
 def err_expected_semi_after_expr : Error<"expected ';' after expression">;
+def warn_expected_stmt_before_semi_in_secondary_block : Warning<
----------------
AaronBallman wrote:

GCC, TCC, and SDCC all reject rather than warn.
MSVC accepts without any diagnostic even with /Wall

I think it makes sense to support this as a Clang extension with a pedantic 
diagnostic. C++ compatibility is one reason, the amount of time Clang has 
accepted this code without diagnosing is another. But given the other compilers 
which reject, I think an on-by-default warning makes sense. How about `ExtWarn` 
and reword it slightly to: `ISO C does not allow an attribute list to appear 
here`?

We currently have:
```
def ext_cxx11_attr_placement : ExtWarn<
  "ISO C++ does not allow %select{an attribute list|%0}1 to appear here">,
  InGroup<DiagGroup<"cxx-attribute-extension">>;
```
and so I think it would make sense to have `c-attribute-extension` as a 
diagnostic group for this rather than C++ compatibility.

https://github.com/llvm/llvm-project/pull/146224
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to