From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 1AFD03858D1E; Sat, 24 Dec 2022 22:04:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1AFD03858D1E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1671919470; bh=j27Q9S+xScaXm+BaOBV29nJkP0DjUE5Xgp4n8BCLXL0=; h=From:To:Subject:Date:From; b=cacSCyl8hCjIcBDFkJwv6aM5cSmVe7jZfHDNH7zhYgtB9WFPeFlq+dZopPgziXL6+ 4Cty/f1AXYfyVPLwtLfRRbYWxHpykTI8WWjqg7A4+I2rioUeEb0aekrgTXiXi4gMfI JcY/FY0hrCvJxLy/MaiIXioFjEWj45zslykkFmN8= From: "vanyacpp at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/108219] New: requirement fails on a valid expression Date: Sat, 24 Dec 2022 22:04:29 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 12.2.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: vanyacpp at gmail 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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: 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=3D108219 Bug ID: 108219 Summary: requirement fails on a valid expression Product: gcc Version: 12.2.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: vanyacpp at gmail dot com Target Milestone: --- This code compiles OK on clang, MSVC and GCC prior to 12: template concept test =3D requires { new T[1]{{ 42 }}; }; struct foobar { foobar(int); }; int main() { static_assert(test); new foobar[1]{{ 42 }}; } But on GCC 12 it produces an error: :14:19: error: static assertion failed 14 | static_assert(test); | ^~~~~~~~~~~~ :14:19: note: constraints not satisfied :2:9: required by the constraints of 'template concept t= est' :2:16: in requirements [with T =3D foobar] :4:5: note: the required expression 'new T(1)' is invalid, because 4 | new T[1]{{ 42 }}; | ^~~~~~~~~~~~~~~~ :4:5: error: could not convert '()' from '' to 'foobar' 4 | new T[1]{{ 42 }}; | ^~~~~~~~~~~~~~~~ | | | I believe the error is incorrect and that this is a regression in GCC 12.=