https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126314
Bug ID: 126314
Summary: ICE: in cp_gimplify_expr, at cp/cp-gimplify.cc:1049
Product: gcc
Version: 17.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: eczbek.void at gmail dot com
Target Milestone: ---
https://godbolt.org/z/nedanbTzf
There's also a linker error at the end, which doesn't happen with Clang.
```cpp
struct base {
const char* data;
template<auto n>
constexpr base(const char(&data)[n])
: data(std::is_constant_evaluated() ? std::define_static_string(data) :
data) {}
};
struct derived : base {
using base::base;
};
int main() {
derived("");
}
```
```
<source>: In function 'int main()':
<source>:17:19: internal compiler error: in cp_gimplify_expr, at
cp/cp-gimplify.cc:1049
17 | derived("");
| ^
0x2b4d9b8 diagnostics::context::diagnostic_impl(rich_location*,
diagnostics::metadata const*, diagnostics::option_id, char const*,
__va_list_tag (*) [1], diagnostics::kind)
???:0
0x2b425fb internal_error(char const*, ...)
???:0
0xb3a314 fancy_abort(char const*, int, char const*)
???:0
0x121fa6b gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
???:0
0x122217c gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
???:0
0x12214d7 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
???:0
0x122409a gimplify_stmt(tree_node**, gimple**)
???:0
0x1220e2b gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
???:0
0x122d2b6 gimplify_body(tree_node*, bool)
???:0
0x122d77c gimplify_function_tree(tree_node*)
???:0
0xff84f7 cgraph_node::analyze()
???:0
0xffb9c6 symbol_table::finalize_compilation_unit()
???:0
/cefs/b3/b3e45b253ee757fdef4b68cc_gcc-trunk-20260718/bin/../libexec/gcc/x86_64-linux-gnu/17.0.0/cc1plus
-quiet -imultiarch x86_64-linux-gnu -iprefix
/cefs/b3/b3e45b253ee757fdef4b68cc_gcc-trunk-20260718/bin/../lib/gcc/x86_64-linux-gnu/17.0.0/
-D_GNU_SOURCE <source> -quiet -dumpdir /app/ -dumpbase output.cpp -dumpbase-ext
.cpp -masm=intel -mtune=generic -march=x86-64 -g -std=c++26
-fdiagnostics-color=always -fno-verbose-asm -freflection -o /app/output.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.
```