================ @@ -990,6 +990,8 @@ def warn_main_redefined : Warning<"variable named 'main' with external linkage " "has undefined behavior">, InGroup<Main>; def ext_main_used : Extension< "referring to 'main' within an expression is a Clang extension">, InGroup<Main>; +def err_main_invalid_linkage_specification : ExtWarn< + "'main' cannot have linkage specification 'extern \"C\"'">, InGroup<Main>; ---------------- Sirraide wrote:
```suggestion "'main' should not be extern \"C\"">, InGroup<Main>; ``` I think something like this would be better imo; I don’t like ‘cannot’ since we still accept the code, so it’s not technically correct that it *cannot* have a linkage specification (it can’t according to the standard, but only EDG currently diagnoses this, and even then it’s just a warning), it just really *shouldn’t*. https://github.com/llvm/llvm-project/pull/101853 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits