From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 8FAF2395205E; Wed, 22 Apr 2020 20:39:38 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8FAF2395205E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1587587978; bh=zRMGNEl106kHC/dijf42nzeze9bbCVDvnWZz3thiTAA=; h=From:To:Subject:Date:In-Reply-To:References:From; b=OgqiiQntsIy3bHER9/pOSR/inCetuv6yzrAMPK1oY90HePWMkKnm52oaR+eJn3ITX WGB/3K2C/eQJvhVPjtGNvo2vKmlePHH3AKn8AhBHPHyRiH6UKl1Xdec2YPbeFXp05c lCH/YZnioBbbjCbmIr33GsEOwpXt4m/D6kF2CSpw= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/94510] [9 Regression] nullptr_t implicitly cast to zero twice in std::array Date: Wed, 22 Apr 2020 20:39:38 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 9.3.0 X-Bugzilla-Keywords: accepts-invalid, patch X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: msebor at gcc dot gnu.org X-Bugzilla-Target-Milestone: 9.4 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Apr 2020 20:39:38 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D94510 --- Comment #13 from CVS Commits --- The releases/gcc-9 branch has been updated by Jason Merrill : https://gcc.gnu.org/g:35699e75a502bb25a2cb23a456e8d6f036b8f226 commit r9-8526-g35699e75a502bb25a2cb23a456e8d6f036b8f226 Author: Martin Sebor Date: Tue Apr 21 11:02:06 2020 -0400 c++: reject scalar array initialization with nullptr [PR94510] The change committed to GCC 9 to allow string literals as template arguments caused the compiler to prune away, and thus miss diagnosing, conversion from nullptr to int in an array initializer. After looking at various approaches to improving the pruning, we realized that the only place the pruning is necessary is in the mangler. gcc/cp/ChangeLog 2020-04-21 Martin Sebor Jason Merrill PR c++/94510 * decl.c (reshape_init_array_1): Avoid stripping redundant trai= ling zero initializers... * mangle.c (write_expression): ...and handle them here even for pointers to members by calling zero_init_expr_p. * cp-tree.h (zero_init_expr_p): Declare. * tree.c (zero_init_expr_p): Define. (type_initializer_zero_p): Remove. * pt.c (tparm_obj_values): New hash_map. (get_template_parm_object): Store to it. (tparm_object_argument): New. gcc/testsuite/ChangeLog 2020-04-21 Martin Sebor PR c++/94510 * g++.dg/init/array58.C: New test. * g++.dg/init/array59.C: New test. * g++.dg/cpp2a/nontype-class34.C: New test. * g++.dg/cpp2a/nontype-class35.C: New test.=