From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id E96FB3858C2F; Fri, 6 Oct 2023 05:31:11 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E96FB3858C2F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1696570271; bh=EnUSi9XQ7SNf/4t52Iwccz8acOzCp9l703mYKcP+Ihg=; h=From:To:Subject:Date:From; b=ZjmRTLA7otA2Ckyp0Xhj54rtzCRUOTKjXWtljAc5D+XBa8fuuTGdZS9A49BDfsCCH 0Quw6idDim011HQdLaWr5NVlT/1FJS+cHiy5d1NXihKjAusxkaX3oMrLx6hQKnoe9P sdKEI98+bsflz/MI/ReJSTe6VsjEP3sboxy/P3Hg= From: "hewillk at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/111712] New: Syntax error when passing function parameter as NTTP in requires-clause Date: Fri, 06 Oct 2023 05:31:11 +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: hewillk 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=3D111712 Bug ID: 111712 Summary: Syntax error when passing function parameter as NTTP in requires-clause Product: gcc Version: 14.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: hewillk at gmail dot com Target Milestone: --- Regardless of whether the code is well-formed or not, this should be valid syntax https://godbolt.org/z/4qM9nG4WP #include template void f(std::bool_constant b) requires requires { typename std::bool_constant; }; int main() { f(std::true_type{}); } However, GCC givs :5:54: error: template argument 1 is invalid :5:37: error: invalid use of template-name 'std::bool_constant' wit= hout an argument list 5 | requires requires { typename std::bool_constant; }; | ^~~~~~~~~~~~~ In file included from :1: /opt/compiler-explorer/gcc-trunk-20231005/include/c++/14.0.0/type_traits:12= 0:11: note: 'template using std::bool_constant =3D std::__bool_constant= <__v>' declared here 120 | using bool_constant =3D __bool_constant<__v>; | ^~~~~~~~~~~~~ :5:50: error: expected '(' before '<' token 5 | requires requires { typename std::bool_constant; }; | ^ | ( :5:55: error: expected primary-expression before ';' token 5 | requires requires { typename std::bool_constant; }; | ^=