public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/101733] New: simple-requirement prefixed with typename interpreted as type-requirement
@ 2021-08-02 19:17 johelegp at gmail dot com
2021-08-02 19:49 ` [Bug c++/101733] " pinskia at gcc dot gnu.org
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: johelegp at gmail dot com @ 2021-08-02 19:17 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101733
Bug ID: 101733
Summary: simple-requirement prefixed with typename interpreted
as type-requirement
Product: gcc
Version: 11.0
Status: UNCONFIRMED
Keywords: rejects-valid
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: johelegp at gmail dot com
CC: johelegp at gmail dot com
Target Milestone: ---
See https://godbolt.org/z/q67Mserar.
```C++
template<class T>
concept C = requires {
typename T::x();
typename T::x() + 1;
1 + typename T::x();
};
```
```
<source>:3:16: error: expected ';' before '(' token
3 | typename T::x();
| ^
| ;
<source>:4:16: error: expected ';' before '(' token
4 | typename T::x() + 1;
| ^
| ;
Compiler returned: 1
```
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug c++/101733] simple-requirement prefixed with typename interpreted as type-requirement
2021-08-02 19:17 [Bug c++/101733] New: simple-requirement prefixed with typename interpreted as type-requirement johelegp at gmail dot com
@ 2021-08-02 19:49 ` pinskia at gcc dot gnu.org
2022-10-18 12:39 ` redi at gcc dot gnu.org
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-08-02 19:49 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101733
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever confirmed|0 |1
Last reconfirmed| |2021-08-02
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Confirmed.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug c++/101733] simple-requirement prefixed with typename interpreted as type-requirement
2021-08-02 19:17 [Bug c++/101733] New: simple-requirement prefixed with typename interpreted as type-requirement johelegp at gmail dot com
2021-08-02 19:49 ` [Bug c++/101733] " pinskia at gcc dot gnu.org
@ 2022-10-18 12:39 ` redi at gcc dot gnu.org
2022-11-26 16:12 ` jason at gcc dot gnu.org
2022-11-28 20:52 ` cvs-commit at gcc dot gnu.org
3 siblings, 0 replies; 5+ messages in thread
From: redi at gcc dot gnu.org @ 2022-10-18 12:39 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101733
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Last reconfirmed|2021-08-02 00:00:00 |2022-10-18
--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
template<class T>
requires requires {
typename T::type;
(typename T::type()); // (1)
T::type(); // (2)
typename T::type(); // (3)
}
void f(T) { }
All compilers accept (1) and (2) but only Clang accepts (3)
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug c++/101733] simple-requirement prefixed with typename interpreted as type-requirement
2021-08-02 19:17 [Bug c++/101733] New: simple-requirement prefixed with typename interpreted as type-requirement johelegp at gmail dot com
2021-08-02 19:49 ` [Bug c++/101733] " pinskia at gcc dot gnu.org
2022-10-18 12:39 ` redi at gcc dot gnu.org
@ 2022-11-26 16:12 ` jason at gcc dot gnu.org
2022-11-28 20:52 ` cvs-commit at gcc dot gnu.org
3 siblings, 0 replies; 5+ messages in thread
From: jason at gcc dot gnu.org @ 2022-11-26 16:12 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101733
Jason Merrill <jason at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jason at gcc dot gnu.org
Last reconfirmed|2022-10-18 00:00:00 |2021-08-02 0:00
Assignee|unassigned at gcc dot gnu.org |jason at gcc dot gnu.org
Status|NEW |ASSIGNED
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug c++/101733] simple-requirement prefixed with typename interpreted as type-requirement
2021-08-02 19:17 [Bug c++/101733] New: simple-requirement prefixed with typename interpreted as type-requirement johelegp at gmail dot com
` (2 preceding siblings ...)
2022-11-26 16:12 ` jason at gcc dot gnu.org
@ 2022-11-28 20:52 ` cvs-commit at gcc dot gnu.org
3 siblings, 0 replies; 5+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-11-28 20:52 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101733
--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jason Merrill <jason@gcc.gnu.org>:
https://gcc.gnu.org/g:2b0ae7fb91f64fb005abf7d7903fd4c0764bb45c
commit r13-4380-g2b0ae7fb91f64fb005abf7d7903fd4c0764bb45c
Author: Jason Merrill <jason@redhat.com>
Date: Sat Nov 26 11:13:55 2022 -0500
c++: simple-requirement starting with 'typename' [PR101733]
Usually a requirement starting with 'typename' is a type-requirement, but
it
might be a simple-requirement such as a functional cast to a typename-type.
PR c++/101733
gcc/cp/ChangeLog:
* parser.cc (cp_parser_requirement): Parse tentatively for the
'typename' case.
gcc/testsuite/ChangeLog:
* g++.dg/cpp2a/concepts-requires32.C: New test.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2022-11-28 20:52 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-02 19:17 [Bug c++/101733] New: simple-requirement prefixed with typename interpreted as type-requirement johelegp at gmail dot com
2021-08-02 19:49 ` [Bug c++/101733] " pinskia at gcc dot gnu.org
2022-10-18 12:39 ` redi at gcc dot gnu.org
2022-11-26 16:12 ` jason at gcc dot gnu.org
2022-11-28 20:52 ` cvs-commit 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).