[clang] [clang] Add test for CWG2811 "Clarify "use" of main" (PR #96168)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 20 07:57:14 PDT 2024


================
@@ -964,7 +964,7 @@ def err_main_global_variable :
 def warn_main_redefined : Warning<"variable named 'main' with external linkage "
     "has undefined behavior">, InGroup<Main>;
 def ext_main_used : Extension<
-  "ISO C++ does not allow 'main' to be used by a program">, InGroup<Main>;
+  "expressions that refer to 'main' are an extension">, InGroup<Main>;
----------------
AaronBallman wrote:

Good point about `decltype` accepting an expression. This is fine by me.

https://github.com/llvm/llvm-project/pull/96168


More information about the cfe-commits mailing list