From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id CABFF3858C41; Sat, 1 Jul 2023 18:15:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CABFF3858C41 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1688235327; bh=fHc6Y1srig1Jd14g+OTM3hGLhg8DJ52CcWTptfdJsPI=; h=From:To:Subject:Date:From; b=NS9jZ5J9xmC71YJpWJtsysxn0glUtVCux5muQPAaS/FGvHRRriL8FZDFCKvY3kJit 48cXSp/KVb1slMJHhQ0UVHZtA4KtY9mKogldHR6w+M6fBL0l3i/OmT8n4WgZMCV5E0 sQzI/H9FV9xpaKRC1y5/6tj3Orh0OJq9IYUfXXwk= From: "fchelnokov at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/110513] New: Invalid use of incomplete type std::bool_constant inside requires expression Date: Sat, 01 Jul 2023 18:15:26 +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: 13.1.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: fchelnokov 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=3D110513 Bug ID: 110513 Summary: Invalid use of incomplete type std::bool_constant inside requires expression Product: gcc Version: 13.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: fchelnokov at gmail dot com Target Milestone: --- The following program #include struct B { bool b =3D true; }; // ok everywhere static_assert( std::bool_constant{}() ); // error in GCC static_assert( requires() { std::bool_constant{}(); } ); is accepted in Clang and MSVC, but GCC complains :11:56: error: invalid use of incomplete type 'std::bool_constant' 11 | static_assert( requires() { std::bool_constant{}(); } ); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~ In file included from :1: /opt/compiler-explorer/gcc-13.1.0/include/c++/13.1.0/type_traits:62:12: not= e: declaration of 'std::bool_constant' 62 | struct integral_constant | ^~~~~~~~~~~~~~~~~ Online demo: https://gcc.godbolt.org/z/csKanbM88=