public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/88557] Lambda in template parameter list compiler segmentation fault (ICE)
[not found] <bug-88557-4@http.gcc.gnu.org/bugzilla/>
@ 2021-08-07 1:42 ` pinskia at gcc dot gnu.org
2024-04-14 0:08 ` pinskia at gcc dot gnu.org
1 sibling, 0 replies; 2+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-08-07 1:42 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88557
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Ever confirmed|0 |1
Keywords|ice-on-invalid-code |ice-on-valid-code
Last reconfirmed| |2021-08-07
Status|UNCONFIRMED |NEW
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
The first example works on the trunk.
The second example has an template missing but even adding that, the ICE is
still there.
^ permalink raw reply [flat|nested] 2+ messages in thread
* [Bug c++/88557] Lambda in template parameter list compiler segmentation fault (ICE)
[not found] <bug-88557-4@http.gcc.gnu.org/bugzilla/>
2021-08-07 1:42 ` [Bug c++/88557] Lambda in template parameter list compiler segmentation fault (ICE) pinskia at gcc dot gnu.org
@ 2024-04-14 0:08 ` pinskia at gcc dot gnu.org
1 sibling, 0 replies; 2+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-04-14 0:08 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88557
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |c++-lambda, rejects-valid
Last reconfirmed|2021-08-07 00:00:00 |2024-4-13
--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Now we are rejecting this valid C++17 code:
```
template<int = []()constexpr{ return 0; }()>
void f() { }
```
With:
```
<source>:3:21: error: lambda-expression in template-argument only available
with '-std=c++2a' or '-std=gnu++2a'
3 | template<int = []()constexpr{ return 0; }()>
| ^
```
Because I would have assumed calling a constexpr lambda would be a valid C++17
code.
We even reject this and cause an ICE:
```
template<int = [](auto)constexpr{ return 0; }.operator()(1)>
void f() { }
```
But those examples are all valid C++17 due to constexpr'ness.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-04-14 0:08 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <bug-88557-4@http.gcc.gnu.org/bugzilla/>
2021-08-07 1:42 ` [Bug c++/88557] Lambda in template parameter list compiler segmentation fault (ICE) pinskia at gcc dot gnu.org
2024-04-14 0:08 ` pinskia 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).