From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id D81223955CA3; Tue, 10 Jan 2023 15:16:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D81223955CA3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1673363812; bh=33BdZJZDAxNGOUdfwXLIVn3QTke0vnizRk84NL8+Uu4=; h=From:To:Subject:Date:In-Reply-To:References:From; b=sUPgRjrZUjaKqE4LxrTAPGmuJoSspwseOVFF5Lyq4zqRCMsHi57IoMSYDp6iRSQhD NEiI79+P0pcUIKRYIMj0PASOd2Gif/VEucSSjdNhig9xTtCY+xi46dqxkwOY+0+6vg iWgNF0hul+ey/1purdIokQ5zhPjZ6iZu/s+PKnUg= From: "ppalka at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/108218] [12/13 Regression] Constant arguments in the new expression is not checked in unevaluated operand since r12-5253-g4df7f8c79835d569 Date: Tue, 10 Jan 2023 15:16:51 +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: 12.1.0 X-Bugzilla-Keywords: accepts-invalid, rejects-valid X-Bugzilla-Severity: normal X-Bugzilla-Who: ppalka at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 12.3 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc see_also 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D108218 Patrick Palka changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |ppalka at gcc dot gnu.org See Also| |https://gcc.gnu.org/bugzill | |a/show_bug.cgi?id=3D108219 --- Comment #9 from Patrick Palka --- (In reply to Steven Sun from comment #7) > I got one simple idea as a workaround. I do not have the resources to do = the > tests. FWIW that seems like the right idea, but it regresses gcc/testsuite/g++.dg/DRs/dr2392.C: $ cat gcc/testsuite/g++.dg/DRs/dr2392.C // DR 2392 // { dg-do compile { target c++11 } } template constexpr int foo () { T t; return 1; } using V =3D decltype (new int[foo ()]); $ gcc gcc/testsuite/g++.dg/DRs/dr2392.C gcc/testsuite/g++.dg/DRs/dr2392.C: In instantiation of =E2=80=98constexpr i= nt foo() [with T =3D void]=E2=80=99: gcc/testsuite/g++.dg/DRs/dr2392.C:12:33: required from here gcc/testsuite/g++.dg/DRs/dr2392.C:8:5: error: variable or field =E2=80=98t= =E2=80=99 declared void 8 | T t; | ^=