https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113498
Bug ID: 113498
Summary: ICE in GCC trunk: tree check: have using_decl in
get_template_info, at cp/pt.cc:357
Product: gcc
Version: 14.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: bobmiller at nvidia dot com
Target Milestone: ---
Created attachment 57154
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57154&action=edit
GCC Bug report generated via -freport-bug
the exact version of GCC: Any GCC trunk at/after 14.0.0-20240107gita6b8d8f919c4
the system type: x86_64-pc-linux-gnu
the options given when GCC was configured/built: ../configure
--prefix=/opt/gcc-latest --enable-languages=c,c++ --enable-libstdcxx-debug
--enable-libstdcxx-backtrace --disable-bootstrap --disable-multilib
--disable-libvtv --with-system-zlib --without-isl --enable-multiarch
the complete command line that triggers the bug: ./g++ -O3 --std=c++23 -Wall
-Wextra -pedantic -freport-bug /test.cpp -o /test
the compiler output (error messages, warnings, etc.):
the preprocessed file (*.i*) that triggers the bug, generated by adding
-save-temps to the complete compilation command, or, in the case of a bug
report for the GNAT front end, a complete set of source files (see below): This
is the file attached to this bug.
root@ceceda56193b:/opt/gcc-latest/bin# ./g++ -O3 --std=c++23 -Wall -Wextra
-pedantic -freport-bug /test.cpp -o /test
/test.cpp: In instantiation of 'constexpr ThisTT<T, Dims ...> S<ThisTT, T,
Dims>::f() const requires ('using_decl' not supported by expression) > 0 [with
ThisTT = S2; T = int; long unsigned int ...Dims = {1, 1}]':
/test.cpp:30:9: required from here
30 | s2.f();
| ~~~~^~
/test.cpp:18:26: error: no return statement in 'constexpr' function returning
non-void
18 | requires(D > 0) {}
| ^
/test.cpp: In instantiation of 'constexpr ThisTT<T, Dims ...> S<ThisTT, T,
Dims>::f() const requires ('using_decl' not supported by expression) > 0 [with
ThisTT = S2; T = int; long unsigned int ...Dims = {1, 1}]':
/test.cpp:17:34: internal compiler error: tree check: expected var_decl or
function_decl or field_decl or type_decl or concept_decl or template_decl, have
using_decl in get_template_info, at cp/pt.cc:357
17 | constexpr ThisTT<T, Dims...> f() const
| ^
0x7994c4 tree_check_failed(tree_node const*, char const*, int, char const*,
...)
../../gcc/tree.cc:8954
0xafa224 template_info_decl_check(tree_node const*, char const*, int, char
const*)
../../gcc/cp/cp-tree.h:665
0xafa224 get_template_info(tree_node const*)
../../gcc/cp/pt.cc:357
0xb0455f most_general_template(tree_node const*)
../../gcc/cp/pt.cc:26017
0xa063f2 write_unqualified_name
../../gcc/cp/mangle.cc:1601
0xa12561 write_nested_name
../../gcc/cp/mangle.cc:1273
0xa13159 write_encoding
../../gcc/cp/mangle.cc:938
0xa1338b write_mangled_name
../../gcc/cp/mangle.cc:820
0xa0a00f write_expression
../../gcc/cp/mangle.cc:3441
0xa08f8e write_expression
../../gcc/cp/mangle.cc:3942
0xa1327d write_constraint_expression
../../gcc/cp/mangle.cc:860
0xa1327d write_encoding
../../gcc/cp/mangle.cc:968
0xa1338b write_mangled_name
../../gcc/cp/mangle.cc:820
0xa15138 mangle_decl_string
../../gcc/cp/mangle.cc:4420
0xa153d8 get_mangled_id
../../gcc/cp/mangle.cc:4441
0xa153d8 mangle_decl(tree_node*)
../../gcc/cp/mangle.cc:4479
0x16a2175 decl_assembler_name(tree_node*)
../../gcc/tree.cc:719
0xd947ab symtab_node::get_comdat_group_id()
../../gcc/cgraph.h:258
0xd947ab analyze_functions
../../gcc/cgraphunit.cc:1200
0xd960cd symbol_table::finalize_compilation_unit()
../../gcc/cgraphunit.cc:2555
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.
Please let me know if additional information is required :D