public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/111712] New: Syntax error when passing function parameter as NTTP in requires-clause
@ 2023-10-06 5:31 hewillk at gmail dot com
2023-10-06 9:03 ` [Bug c++/111712] " pinskia at gcc dot gnu.org
2023-10-06 13:42 ` ppalka at gcc dot gnu.org
0 siblings, 2 replies; 3+ messages in thread
From: hewillk at gmail dot com @ 2023-10-06 5:31 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111712
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 <type_traits>
template<bool B>
void f(std::bool_constant<B> b)
requires requires { typename std::bool_constant<b()>; };
int main() {
f(std::true_type{});
}
However, GCC givs
<source>:5:54: error: template argument 1 is invalid
<source>:5:37: error: invalid use of template-name 'std::bool_constant' without
an argument list
5 | requires requires { typename std::bool_constant<b()>; };
| ^~~~~~~~~~~~~
In file included from <source>:1:
/opt/compiler-explorer/gcc-trunk-20231005/include/c++/14.0.0/type_traits:120:11:
note: 'template<bool __v> using std::bool_constant = std::__bool_constant<__v>'
declared here
120 | using bool_constant = __bool_constant<__v>;
| ^~~~~~~~~~~~~
<source>:5:50: error: expected '(' before '<' token
5 | requires requires { typename std::bool_constant<b()>; };
| ^
| (
<source>:5:55: error: expected primary-expression before ';' token
5 | requires requires { typename std::bool_constant<b()>; };
| ^
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-10-06 13:42 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-06 5:31 [Bug c++/111712] New: Syntax error when passing function parameter as NTTP in requires-clause hewillk at gmail dot com
2023-10-06 9:03 ` [Bug c++/111712] " pinskia at gcc dot gnu.org
2023-10-06 13:42 ` ppalka at gcc dot gnu.org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).