================
@@ -990,6 +990,12 @@ 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 ext_main_invalid_linkage_specification : ExtWarn<
+  "'main' should not be "
+  "'extern \"%select{C|C++}0\"'">, InGroup<Main>;
+def err_main_invalid_linkage_specification : Error<
+  "'main' should not be "
+  "'extern \"%select{C|C++}0\"'">;
----------------
Sirraide wrote:

Thinking about this again, I think making these an error by default is a bit 
too strong; no-one else does that by default; the most you’ll get is a warning 
from EDG and a pedantic warning from GCC. I think making this a single 
`ExtWarn` is fine.

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

Reply via email to