[clang] [Sema] Add -Wc++11-narrowing-const-reference (PR #76094)
Fangrui Song via cfe-commits
cfe-commits at lists.llvm.org
Sun Jan 7 23:24:54 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.
----------------
MaskRay wrote:
I created #77278 to simplify the code.
https://github.com/llvm/llvm-project/pull/76094
More information about the cfe-commits
mailing list