https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97632

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
                 CC|                            |mpolacek at gcc dot gnu.org
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2020-10-29

--- Comment #1 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Thus:

--- a/gcc/cp/init.c
+++ b/gcc/cp/init.c
@@ -2957,7 +2957,7 @@ build_new_1 (vec<tree, va_gc> **placement, tree type,
tree nelts,
       return error_mark_node;
     }

-  if (is_std_init_list (elt_type))
+  if (is_std_init_list (elt_type) && !cp_unevaluated_operand)
     warning (OPT_Winit_list_lifetime,
         "%<new%> of %<initializer_list%> does not "
         "extend the lifetime of the underlying array");

Reply via email to