[clang] [Sema] Add -Wc++11-narrowing-const-reference (PR #76094)
Nico Weber via cfe-commits
cfe-commits at lists.llvm.org
Fri Dec 22 08:27:56 PST 2023
================
@@ -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.
----------------
nico wrote:
FYI, you can give them the same text without duplicating the text by doing something like:
```
def warn_objc_pointer_masking_performSelector : Warning<warn_objc_pointer_masking.Summary>,
InGroup<ObjCPointerIntrospectPerformSelector>;
```
https://github.com/llvm/llvm-project/pull/76094
More information about the cfe-commits
mailing list