[clang] [Sema] Add -Wc++11-narrowing-const-reference (PR #76094)

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 3 07:04:42 PST 2024


================
@@ -6158,12 +6158,24 @@ def err_illegal_initializer_type : Error<"illegal initializer type %0">;
 def ext_init_list_type_narrowing : ExtWarn<
   "type %0 cannot be narrowed to %1 in initializer list">,
   InGroup<CXX11Narrowing>, DefaultError, SFINAEFailure;
+// *_narrowing_const_reference diagnostics have the same messages, but are
+// controlled by -Wc++11-narrowing-const-reference for narrowing involving a
+// const reference.
----------------
erichkeane wrote:

@nico: if you haven't already, please do this in a follow up patch (since you've merged this!).

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


More information about the cfe-commits mailing list