From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id F29563858D1E; Sat, 24 Dec 2022 16:00:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F29563858D1E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1671897641; bh=Mdq65plco2/HbKlVfzppoLxVjC+eT+Cx9EQZoxZNiT8=; h=From:To:Subject:Date:In-Reply-To:References:From; b=mlK7vsIyap/AwhLPMzlp4aeb6VcbWwHLulaJViJ5p4tBPXpYXXhfFv6V1/qY7J+cJ VSyBmHQgz79rq2oqBMhmQx5RFeG9KkYOiINu75c25WbuYHaptOwiYkPHr0EcmRipxX BZM0AJKeuN2wTSrFU2a+/A2EdpxVpCjupIpgV6iQ= From: "StevenSun2021 at hotmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/108218] [12 Regression] Constant arguments in the new expression is not checked in unevaluated operand Date: Sat, 24 Dec 2022 16:00:41 +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: X-Bugzilla-Severity: normal X-Bugzilla-Who: StevenSun2021 at hotmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D108218 --- Comment #1 from Steven Sun --- My concern is that, expressions within the require expressions are also considered as "unevaluated operands". Thus, the following concept is evaluated as true, but the program is ill-fo= rmed and does not compile (since gcc 12) https://godbolt.org/z/bcc398chG ``` template concept C =3D requires { new int[(int)sizeof(T) - 4]; }; template requires C class CC { CC() { new int[(int)sizeof(T) - 4]; } }; template class CC; ``` : In instantiation of 'CC::CC() [with T =3D char]': :16:16: required from here :12:32: error: size '-3' of array is negative 12 | new int[(int)sizeof(T) - 4]; | ~~~~~~~~~~~~~~~^~~=