https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113746
Bug ID: 113746 Summary: [14 Regression] ICE: tree check: expected enumeral_type, have error_mark in tsubst_expr, at cp/pt.cc:21458 with missing typename Product: gcc Version: 14.0 Status: UNCONFIRMED Keywords: ice-on-invalid-code Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: zsojka at seznam dot cz Target Milestone: --- Host: x86_64-pc-linux-gnu Target: x86_64-pc-linux-gnu Created attachment 57313 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57313&action=edit reduced testcase Compiler output: $ x86_64-pc-linux-gnu-gcc testcase.C -wrapper valgrind,-q testcase.C:1:12: error: 'typename_T' has not been declared 1 | template < typename_T > struct S { | ^~~~~~~~~~ testcase.C:2:24: internal compiler error: tree check: expected enumeral_type, have error_mark in tsubst_expr, at cp/pt.cc:21458 2 | enum { e0 = 0, e00 = e0 }; | ^~ 0x96eab7 tree_check_failed(tree_node const*, char const*, int, char const*, ...) /repo/gcc-trunk/gcc/tree.cc:8952 ==27631== Invalid read of size 1 ==27631== at 0x2DF67C0: x86_64_fallback_frame_state (md-unwind-support.h:63) ==27631== by 0x2DF67C0: uw_frame_state_for (unwind-dw2.c:1013) ==27631== by 0x2DF7AFD: _Unwind_Backtrace (unwind.inc:303) ==27631== by 0x2DA0F49: backtrace_full (backtrace.c:127) ==27631== by 0x2D03556: diagnostic_context::action_after_output(diagnostic_t) (diagnostic.cc:781) ==27631== by 0x2D0376B: diagnostic_action_after_output (diagnostic.h:1002) ==27631== by 0x2D0376B: diagnostic_context::report_diagnostic(diagnostic_info*) (diagnostic.cc:1633) ==27631== by 0x2D03AE8: diagnostic_impl(rich_location*, diagnostic_metadata const*, int, char const*, __va_list_tag (*) [1], diagnostic_t) (diagnostic.cc:1767) ==27631== by 0x2D041B6: internal_error(char const*, ...) (diagnostic.cc:2225) ==27631== by 0x96EAB7: tree_check_failed(tree_node const*, char const*, int, char const*, ...) (tree.cc:8952) ==27631== Address 0x1 is not stack'd, malloc'd or (recently) free'd ==27631== testcase.C:2:24: internal compiler error: Segmentation fault 0x1816b62 crash_signal /repo/gcc-trunk/gcc/toplev.cc:317 0x2df67c0 x86_64_fallback_frame_state ./md-unwind-support.h:63 0x2df67c0 uw_frame_state_for /repo/gcc-trunk/libgcc/unwind-dw2.c:1013 0x2df7afd _Unwind_Backtrace /repo/gcc-trunk/libgcc/unwind.inc:303 0x2da0f49 backtrace_full /repo/gcc-trunk/libbacktrace/backtrace.c:127 0x2d03556 diagnostic_context::action_after_output(diagnostic_t) /repo/gcc-trunk/gcc/diagnostic.cc:781 0x2d0376b diagnostic_action_after_output(diagnostic_context*, diagnostic_t) /repo/gcc-trunk/gcc/diagnostic.h:1002 0x2d0376b diagnostic_context::report_diagnostic(diagnostic_info*) /repo/gcc-trunk/gcc/diagnostic.cc:1633 0x2d03ae8 diagnostic_impl /repo/gcc-trunk/gcc/diagnostic.cc:1767 0x2d041b6 internal_error(char const*, ...) /repo/gcc-trunk/gcc/diagnostic.cc:2225 0x96eab7 tree_check_failed(tree_node const*, char const*, int, char const*, ...) /repo/gcc-trunk/gcc/tree.cc:8952 $ x86_64-pc-linux-gnu-gcc -v Using built-in specs. COLLECT_GCC=/repo/gcc-trunk/binary-latest-amd64/bin/x86_64-pc-linux-gnu-gcc COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-r14-8771-20240203001826-g4b7d4d8a4af-checking-yes-rtl-df-extra-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/14.0.1/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++ --enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra --with-cloog --with-ppl --with-isl --build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu --target=x86_64-pc-linux-gnu --with-ld=/usr/bin/x86_64-pc-linux-gnu-ld --with-as=/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch --prefix=/repo/gcc-trunk//binary-trunk-r14-8771-20240203001826-g4b7d4d8a4af-checking-yes-rtl-df-extra-amd64 Thread model: posix Supported LTO compression algorithms: zlib zstd gcc version 14.0.1 20240203 (experimental) (GCC)