[clang] [C] Warn on uninitialized const objects (PR #137166)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 24 07:21:15 PDT 2025


================
@@ -8197,6 +8197,16 @@ def err_address_space_qualified_new : Error<
 def err_address_space_qualified_delete : Error<
   "'delete' cannot delete objects of type %0 in address space '%1'">;
 
+def note_default_init_const_member : Note<
+  "member %0 declared 'const' here">;
+def warn_default_init_const : Warning<
+  "default initialization of an object of type %0%select{| with const member}1 "
+  "is incompatible with C++">,
+  InGroup<DefaultConstInit>, DefaultIgnore;
+def warn_default_init_const_unsafe : Warning<
----------------
AaronBallman wrote:

No, one is `DefaultIgnore` and the other is not, and they're in different diagnostic groups.

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


More information about the cfe-commits mailing list