https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111592
Bug ID: 111592
Summary: ICE on expanding argument pack into variadic
constructor
Product: gcc
Version: 14.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: yankel-pro at scialom dot org
Target Milestone: ---
GCC raises an Internal Compiler Error in c_common_parse_file() when
(indirectly, see source) expanding an argument pack into a variadic
constructor.
$ g++ --version
g++
(Compiler-Explorer-Build-gcc-1eb80f78f114f6582c349f75e08b361a0a582091-binutils-2.40)
14.0.0 20230925 (experimental)
$ cat source
struct ignore
{ ignore(...) {} };
template<class... Args>
void
InternalCompilerError(Args... args)
{ ignore{ ignore(args) ... }; }
int
main()
{ InternalCompilerError(0, 0); }
$ g++ -c source
<source>: In instantiation of 'void InternalCompilerError(Args ...) [with Args
= {int, int}]':
<source>:11:24: required from here
<source>:7:3: internal compiler error: in finish_expr_stmt, at
cp/semantics.cc:910
7 | { ignore{ ignore(args) ... }; }
| ^~~~~~
0x251c8ee internal_error(char const*, ...)
???:0
0xae8dda fancy_abort(char const*, int, char const*)
???:0
0xcfa8f8 instantiate_decl(tree_node*, bool, bool)
???:0
0xd2dcbb instantiate_pending_templates(int)
???:0
0xbded50 c_parse_final_cleanups()
???:0
0xe149d8 c_common_parse_file()
???:0
Found on Compiler Explorer <https://godbolt.org/z/M788xE44z>.