public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/105921] New: internal compiler error: in cp_parser_template_id, at cp/parser.cc:18362
@ 2022-06-10 19:54 orbisvicis+gcc at gmail dot com
2022-06-10 19:58 ` [Bug c++/105921] " orbisvicis+gcc at gmail dot com
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: orbisvicis+gcc at gmail dot com @ 2022-06-10 19:54 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105921
Bug ID: 105921
Summary: internal compiler error: in cp_parser_template_id, at
cp/parser.cc:18362
Product: gcc
Version: 12.1.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: orbisvicis+gcc at gmail dot com
Target Milestone: ---
Created attachment 53117
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=53117&action=edit
bug.cxx.i
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c++/105921] internal compiler error: in cp_parser_template_id, at cp/parser.cc:18362
2022-06-10 19:54 [Bug c++/105921] New: internal compiler error: in cp_parser_template_id, at cp/parser.cc:18362 orbisvicis+gcc at gmail dot com
@ 2022-06-10 19:58 ` orbisvicis+gcc at gmail dot com
2022-06-16 13:17 ` marxin at gcc dot gnu.org
2022-06-21 2:55 ` pinskia at gcc dot gnu.org
2 siblings, 0 replies; 4+ messages in thread
From: orbisvicis+gcc at gmail dot com @ 2022-06-10 19:58 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105921
--- Comment #1 from Yclept Nemo <orbisvicis+gcc at gmail dot com> ---
AFAICT, the attachment includes everything needed in a bug report. Inlining the
code here for convenience:
#include <utility>
template <typename T, int N>
auto a = (struct A {
template <class T1, int>
using Temp = T1;
template <int... I>
auto get(std::index_sequence<I...>){
return (int (*)( Temp<T,N>... ))nullptr;
}
}){}.get(std::make_index_sequence<N>{});
int main () {
a<int, 4>;
}
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c++/105921] internal compiler error: in cp_parser_template_id, at cp/parser.cc:18362
2022-06-10 19:54 [Bug c++/105921] New: internal compiler error: in cp_parser_template_id, at cp/parser.cc:18362 orbisvicis+gcc at gmail dot com
2022-06-10 19:58 ` [Bug c++/105921] " orbisvicis+gcc at gmail dot com
@ 2022-06-16 13:17 ` marxin at gcc dot gnu.org
2022-06-21 2:55 ` pinskia at gcc dot gnu.org
2 siblings, 0 replies; 4+ messages in thread
From: marxin at gcc dot gnu.org @ 2022-06-16 13:17 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105921
Martin Liška <marxin at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2022-06-16
Ever confirmed|0 |1
CC| |marxin at gcc dot gnu.org
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c++/105921] internal compiler error: in cp_parser_template_id, at cp/parser.cc:18362
2022-06-10 19:54 [Bug c++/105921] New: internal compiler error: in cp_parser_template_id, at cp/parser.cc:18362 orbisvicis+gcc at gmail dot com
2022-06-10 19:58 ` [Bug c++/105921] " orbisvicis+gcc at gmail dot com
2022-06-16 13:17 ` marxin at gcc dot gnu.org
@ 2022-06-21 2:55 ` pinskia at gcc dot gnu.org
2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-06-21 2:55 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105921
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Known to fail| |11.1.0, 6.1.0, 9.1.0
Keywords|ice-on-valid-code |
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Reduced testcase:
template <int T>
auto a = (struct A {}){};
int main () {
a<4>;
}
So GCC declares this as a compound literal where the new type is defined in the
(). It turns out for template variables, GCC is not ready for this.
Note clang rejects this code in both the non-template case and the template
case where defining a new struct is not allowed.
I don't know if we should restrict defining the new struct here or not.
This is not a regression either.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-06-21 2:55 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-10 19:54 [Bug c++/105921] New: internal compiler error: in cp_parser_template_id, at cp/parser.cc:18362 orbisvicis+gcc at gmail dot com
2022-06-10 19:58 ` [Bug c++/105921] " orbisvicis+gcc at gmail dot com
2022-06-16 13:17 ` marxin at gcc dot gnu.org
2022-06-21 2:55 ` 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).