@@ -10410,40 +10410,53 @@ static void DiagnoseNarrowingInInitList(Sema &S,
// No narrowing occurred.
return;
- case NK_Type_Narrowing:
+ case NK_Type_Narrowing: {
// This was a floating-to-integer conversion, which is always considered a
// narrowing conver
@@ -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, DefaultError, SFINAEFailure;
+// *_narrowing_const_reference diagn
@@ -10410,40 +10410,53 @@ static void DiagnoseNarrowingInInitList(Sema &S,
// No narrowing occurred.
return;
- case NK_Type_Narrowing:
+ case NK_Type_Narrowing: {
// This was a floating-to-integer conversion, which is always considered a
// narrowing conver
@@ -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, DefaultError, SFINAEFailure;
+// *_narrowing_const_reference diagn
https://github.com/erichkeane commented:
Please fix the comments in a followup.
https://github.com/llvm/llvm-project/pull/76094
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/erichkeane edited
https://github.com/llvm/llvm-project/pull/76094
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/nico closed https://github.com/llvm/llvm-project/pull/76094
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/nico approved this pull request.
Thanks! I'm going to merge this since it'll unblock quite a few people. I have
a minor comment below that can be addressed in a follow-up.
https://github.com/llvm/llvm-project/pull/76094
___
cfe-comm
https://github.com/nico edited https://github.com/llvm/llvm-project/pull/76094
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -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, DefaultError, SFINAEFailure;
+// *_narrowing_const_reference diagn
https://github.com/MaskRay updated
https://github.com/llvm/llvm-project/pull/76094
>From 132a5293a89d15d3e38c768727723157427f49db Mon Sep 17 00:00:00 2001
From: Fangrui Song
Date: Wed, 20 Dec 2023 10:57:15 -0800
Subject: [PATCH 1/2] [Sema] Add -Wc++11-narrowing-const-reference
https://github.c
@@ -1,5 +1,5 @@
// RUN: %clang_cc1 -fsyntax-only -verify %s
-
+// RUN: %clang_cc1 -fsyntax-only -Wno-c++11-narrowing-const-reference
-verify=allow %s
alexfh wrote:
"allow" is slightly confusing as the verify prefix. Maybe use
`-verify=narrowing` and `-verify=n
https://github.com/alexfh edited https://github.com/llvm/llvm-project/pull/76094
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/alexfh approved this pull request.
Thanks for implementing the separate warning option!
https://github.com/llvm/llvm-project/pull/76094
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/li
ilya-biryukov wrote:
I wanted to mention that it is critical to have an incremental path to
introduce these warnings for our release process at Google.
I hope this is in line with Clang's needs and not too disturbing to the
upstream development. It also helps people with similar needs, i.e. th
@@ -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, DefaultError, SFINAEFailure;
+// *_narrowing_const_reference diagn
@@ -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, DefaultError, SFINAEFailure;
+// *_narrowing_const_reference diagn
https://github.com/MaskRay updated
https://github.com/llvm/llvm-project/pull/76094
>From 132a5293a89d15d3e38c768727723157427f49db Mon Sep 17 00:00:00 2001
From: Fangrui Song
Date: Wed, 20 Dec 2023 10:57:15 -0800
Subject: [PATCH] [Sema] Add -Wc++11-narrowing-const-reference
https://github.com/l
https://github.com/MaskRay updated
https://github.com/llvm/llvm-project/pull/76094
>From cea507db33bc1fe376b4a75c5ff96225a4e0e67e Mon Sep 17 00:00:00 2001
From: Fangrui Song
Date: Wed, 20 Dec 2023 10:57:15 -0800
Subject: [PATCH] [Sema] Add -Wc++11-narrowing-const-reference
https://github.com/l
llvmbot wrote:
@llvm/pr-subscribers-clang
Author: Fangrui Song (MaskRay)
Changes
https://github.com/llvm/llvm-project/pull/75332 diagnosed narrowing
involving const reference. Our depot has hundreds if not thousands of
breakages
(https://github.com/llvm/llvm-project/pull/75332#issuecomment
https://github.com/MaskRay created
https://github.com/llvm/llvm-project/pull/76094
https://github.com/llvm/llvm-project/pull/75332 diagnosed narrowing
involving const reference. Our depot has hundreds if not thousands of
breakages
(https://github.com/llvm/llvm-project/pull/75332#issuecomment-186
21 matches
Mail list logo