https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85553
Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jakub at gcc dot gnu.org Target Milestone|--- |8.0 --- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> --- So shouldn't we then do instead: --- gcc/cp/init.c.jj 2018-04-27 19:11:56.613549524 +0200 +++ gcc/cp/init.c 2018-04-27 19:20:50.102839130 +0200 @@ -180,8 +180,10 @@ build_zero_init_1 (tree type, tree nelts items with static storage duration that are not otherwise initialized are initialized to zero. */ ; - else if (TYPE_PTR_OR_PTRMEM_P (type) || NULLPTR_TYPE_P (type)) + else if (TYPE_PTR_OR_PTRMEM_P (type)) init = fold (convert (type, nullptr_node)); + else if (NULLPTR_TYPE_P (type)) + init = build_int_cst (type, 0); else if (SCALAR_TYPE_P (type)) init = fold (convert (type, integer_zero_node)); else if (RECORD_OR_UNION_CODE_P (TREE_CODE (type))) Then we don't warn on cpp0x/Wzero-as-null-pointer-constant-3.C and accept the value initialization in constexpr.