https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127906
Bug ID: 127906
Summary: ice-on-invalid-code: internal compiler error: in
paste_all_tokens, at libcpp/macro.cc
Product: gcc
Version: 17.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: 0599jiangyc at gmail dot com
Target Milestone: ---
The following code:
```cpp
#define F(...) g(__VA_ARGS__)
int g(int, ...);
int x = F (42,
#embed __FILE__ limit (128)
);
```
Resulted in this output:
```
<source>:3:1: internal compiler error: in paste_all_tokens, at
libcpp/macro.cc:1108
3 | int x = F (42,
| ^~~
0x2c5c1d8 diagnostics::context::diagnostic_impl(rich_location*,
diagnostics::metadata const*, diagnostics::option_id, char const*,
__va_list_tag (*) [1], diagnostics::kind)
???:0
0x2c50e1b internal_error(char const*, ...)
???:0
0xb9d14a fancy_abort(char const*, int, char const*)
???:0
0xf75ada c_lex_with_flags(tree_node**, unsigned long*, unsigned char*, int)
???:0
0xdf757a c_parse_file()
???:0
0xf8b879 c_common_parse_file()
???:0
/cefs/87/87312271d9d31d0a7b41835d_gcc-trunk-20261014/bin/../libexec/gcc/x86_64-linux-gnu/17.0.0/cc1plus
-quiet -imultiarch x86_64-linux-gnu -iprefix
/cefs/87/87312271d9d31d0a7b41835d_gcc-trunk-20261014/bin/../lib/gcc/x86_64-linux-gnu/17.0.0/
-D_GNU_SOURCE <source> -quiet -dumpdir /app/output.s- -dumpbase example.cpp
-dumpbase-ext .cpp -mtune=generic -march=x86-64 -g -fdiagnostics-color=always
-fno-verbose-asm -o /tmp/ccguTzld.s
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
x86-64 gcc (trunk) - 1074ms
```
https://godbolt.org/z/aeWKsfMb9