From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 37E273858D20; Sun, 7 Apr 2024 08:38:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 37E273858D20 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1712479106; bh=G2xNJloSaSsV6uNuD8j5k17/g09COrsZn/6uRfUF7OY=; h=From:To:Subject:Date:From; b=VrgXFTip47X4Q4HvlYmB0i5UvgRDMBEi6h4kHcMGXmzWvcwIgwMOAMpwyHve5E9O3 fqyt0BG40jpQAUUtXUmlknEK7WMOnW8PkYDYm2EzZTCN5Zfjl+RL03yx/k9R95l8NM FGRXTkR6/Le3yMXUR6qWSsLzW9dKMYbr59YahcXk= From: "ted at lyncon dot se" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/114625] New: requires { T{}; } wrongly accepted when T{} is ill-formed Date: Sun, 07 Apr 2024 08:38:25 +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: 14.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: ted at lyncon dot se 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=3D114625 Bug ID: 114625 Summary: requires { T{}; } wrongly accepted when T{} is ill-formed Product: gcc Version: 14.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: ted at lyncon dot se Target Milestone: --- This program compiles but I'd expect both `static_assert`s to refuse it sin= ce `d x{};` is invalid. ``` #include template concept default_initializable =3D std::constructible_from && requires { T{}; } && requires { ::new T; }; struct b { explicit b(auto...) {} }; struct d : b {}; int main() { static_assert(default_initializable); static_assert(std::default_initializable); //d x{}; // ERROR } ```=