https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119347
Bug ID: 119347 Summary: ICE: in tsubst, at cp/pt.cc:16632 Product: gcc Version: 15.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/s5j99Taf5 ```cpp template<typename> struct type_list { using slice = decltype([] {}, 0); template<int> using xform = type_list<slice>; }; using T = type_list<int>::xform<0>; int main() {} ``` ``` Using built-in specs. COLLECT_GCC=/opt/compiler-explorer/gcc-snapshot/bin/g++ Target: x86_64-linux-gnu Configured with: ../gcc-trunk-20250317/configure --prefix=/opt/compiler-explorer/gcc-build/staging --enable-libstdcxx-backtrace=yes --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu --disable-bootstrap --enable-multiarch --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --enable-clocale=gnu --enable-languages=c,c++,fortran,ada,objc,obj-c++,go,d,rust,m2,cobol --enable-ld=yes --enable-gold=yes --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-linker-build-id --enable-lto --enable-plugins --enable-threads=posix --with-pkgversion=Compiler-Explorer-Build-gcc-a3ead22b42de8ddeeb869df2fa9cbdae7af5204d-binutils-2.42 Thread model: posix Supported LTO compression algorithms: zlib gcc version 15.0.1 20250317 (experimental) (Compiler-Explorer-Build-gcc-a3ead22b42de8ddeeb869df2fa9cbdae7af5204d-binutils-2.42) COLLECT_GCC_OPTIONS='-fdiagnostics-color=always' '-g' '-o' '/app/output.s' '-masm=intel' '-fno-verbose-asm' '-S' '-std=c++20' '-v' '-freport-bug' '-shared-libgcc' '-mtune=generic' '-march=x86-64' '-dumpdir' '/app/' /opt/compiler-explorer/gcc-trunk-20250317/bin/../libexec/gcc/x86_64-linux-gnu/15.0.1/cc1plus -quiet -v -imultiarch x86_64-linux-gnu -iprefix /opt/compiler-explorer/gcc-trunk-20250317/bin/../lib/gcc/x86_64-linux-gnu/15.0.1/ -D_GNU_SOURCE <source> -quiet -dumpdir /app/ -dumpbase output.cpp -dumpbase-ext .cpp -masm=intel -mtune=generic -march=x86-64 -g -std=c++20 -version -fdiagnostics-color=always -fno-verbose-asm -freport-bug -o /app/output.s GNU C++20 (Compiler-Explorer-Build-gcc-a3ead22b42de8ddeeb869df2fa9cbdae7af5204d-binutils-2.42) version 15.0.1 20250317 (experimental) (x86_64-linux-gnu) compiled by GNU C version 11.4.0, GMP version 6.2.1, MPFR version 4.1.0, MPC version 1.2.1, isl version isl-0.24-GMP GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096 ignoring nonexistent directory "/opt/compiler-explorer/gcc-trunk-20250317/bin/../lib/gcc/x86_64-linux-gnu/15.0.1/../../../../x86_64-linux-gnu/include" ignoring duplicate directory "/opt/compiler-explorer/gcc-trunk-20250317/bin/../lib/gcc/../../lib/gcc/x86_64-linux-gnu/15.0.1/../../../../include/c++/15.0.1" ignoring duplicate directory "/opt/compiler-explorer/gcc-trunk-20250317/bin/../lib/gcc/../../lib/gcc/x86_64-linux-gnu/15.0.1/../../../../include/c++/15.0.1/x86_64-linux-gnu" ignoring duplicate directory "/opt/compiler-explorer/gcc-trunk-20250317/bin/../lib/gcc/../../lib/gcc/x86_64-linux-gnu/15.0.1/../../../../include/c++/15.0.1/backward" ignoring duplicate directory "/opt/compiler-explorer/gcc-trunk-20250317/bin/../lib/gcc/../../lib/gcc/x86_64-linux-gnu/15.0.1/include" ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu" ignoring duplicate directory "/opt/compiler-explorer/gcc-trunk-20250317/bin/../lib/gcc/../../lib/gcc/x86_64-linux-gnu/15.0.1/include-fixed/x86_64-linux-gnu" ignoring duplicate directory "/opt/compiler-explorer/gcc-trunk-20250317/bin/../lib/gcc/../../lib/gcc/x86_64-linux-gnu/15.0.1/include-fixed" ignoring nonexistent directory "/opt/compiler-explorer/gcc-trunk-20250317/bin/../lib/gcc/../../lib/gcc/x86_64-linux-gnu/15.0.1/../../../../x86_64-linux-gnu/include" #include "..." search starts here: #include <...> search starts here: /opt/compiler-explorer/gcc-trunk-20250317/bin/../lib/gcc/x86_64-linux-gnu/15.0.1/../../../../include/c++/15.0.1 /opt/compiler-explorer/gcc-trunk-20250317/bin/../lib/gcc/x86_64-linux-gnu/15.0.1/../../../../include/c++/15.0.1/x86_64-linux-gnu /opt/compiler-explorer/gcc-trunk-20250317/bin/../lib/gcc/x86_64-linux-gnu/15.0.1/../../../../include/c++/15.0.1/backward /opt/compiler-explorer/gcc-trunk-20250317/bin/../lib/gcc/x86_64-linux-gnu/15.0.1/include /opt/compiler-explorer/gcc-trunk-20250317/bin/../lib/gcc/x86_64-linux-gnu/15.0.1/include-fixed/x86_64-linux-gnu /opt/compiler-explorer/gcc-trunk-20250317/bin/../lib/gcc/x86_64-linux-gnu/15.0.1/include-fixed /usr/local/include /opt/compiler-explorer/gcc-trunk-20250317/bin/../lib/gcc/../../include /usr/include/x86_64-linux-gnu /usr/include End of search list. Compiler executable checksum: 7eb22631251594d4e511620990a18033 <source>: In substitution of 'template<class> template<int <anonymous> > using type_list< <template-parameter-1-1> >::xform = type_list<decltype ((<lambda>, 0))> [with int <anonymous> = 0; <template-parameter-1-1> = int]': <source>:9:34: required from here 9 | using T = type_list<int>::xform<0>; | ^ <source>:3:32: internal compiler error: in tsubst, at cp/pt.cc:16632 3 | using slice = decltype([] {}, 0); | ^~~~~ 0x2913db5 diagnostic_context::diagnostic_impl(rich_location*, diagnostic_metadata const*, diagnostic_option_id, char const*, __va_list_tag (*) [1], diagnostic_t) ???:0 0x292add6 internal_error(char const*, ...) ???:0 0xaccc40 fancy_abort(char const*, int, char const*) ???:0 0xd2517b tsubst(tree_node*, tree_node*, int, tree_node*) ???:0 0xd402c0 tsubst_lambda_expr(tree_node*, tree_node*, int, tree_node*) ???:0 0xd2536d tsubst(tree_node*, tree_node*, int, tree_node*) ???:0 0xd39b26 tsubst_template_args(tree_node*, tree_node*, int, tree_node*) ???:0 0xd24d71 tsubst(tree_node*, tree_node*, int, tree_node*) ???:0 0xd41ffc instantiate_template(tree_node*, tree_node*, int) ???:0 0xd231f2 lookup_template_class(tree_node*, tree_node*, tree_node*, tree_node*, int) ???:0 0xd6d06c finish_template_type(tree_node*, tree_node*, int) ???:0 0xcee07b c_parse_file() ???:0 0xe4f519 c_common_parse_file() ???:0 Please submit a full bug report, with preprocessed source. Please include the complete backtrace with any bug report. See <https://gcc.gnu.org/bugs/> for instructions. Preprocessed source stored into /tmp/ccZ6Sieo.out file, please attach this to your bugreport. Compiler returned: 1 ```