[clang] [clang] [modules] Add err_main_in_named_module (PR #146247)

Chuanqi Xu via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 30 01:29:05 PDT 2025


================
@@ -650,6 +650,9 @@ Improvements to Clang's diagnostics
   #GH69470, #GH59391, #GH58172, #GH46215, #GH45915, #GH45891, #GH44490,
   #GH36703, #GH32903, #GH23312, #GH69874.
 
+- A warning is now emitted when ``main`` is attached to a named module,
+  which can be turned off with ``-Wno-main``. (#GH146247)
----------------
ChuanqiXu9 wrote:

I prefer to change the warning name to `Wmain-attached-to-named-modules`. There were a lot examples declaring a warning with a warning name in place.

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


More information about the cfe-commits mailing list