https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88196
Bug ID: 88196
Summary: ICE on (invalid) C++ code when compiled with
-std=c++2a: in convert_nontype_argument, at
cp/pt.c:7137
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: su at cs dot ucdavis.edu
Target Milestone: ---
This appears to be a recent regression.
$ g++tk -v
Using built-in specs.
COLLECT_GCC=g++tk
COLLECT_LTO_WRAPPER=/home/su/software/tmp/gcc/gcc-trunk/libexec/gcc/x86_64-pc-linux-gnu/9.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc-source-trunk/configure --enable-languages=c,c++,lto
--prefix=/home/su/software/tmp/gcc/gcc-trunk --disable-bootstrap
Thread model: posix
gcc version 9.0.0 20181125 (experimental) [trunk revision 266435] (GCC)
$
$ g++tk -std=c++2a tmp.cpp
tmp.cpp:5:14: internal compiler error: in convert_nontype_argument, at
cp/pt.c:7137
5 | B < C, &C::c > b;
| ^
0x962cb5 convert_nontype_argument
../../gcc-source-trunk/gcc/cp/pt.c:7136
0x976c80 convert_template_argument
../../gcc-source-trunk/gcc/cp/pt.c:8033
0x977b13 coerce_template_parms
../../gcc-source-trunk/gcc/cp/pt.c:8511
0x979d5a lookup_template_class_1
../../gcc-source-trunk/gcc/cp/pt.c:9328
0x979d5a lookup_template_class(tree_node*, tree_node*, tree_node*, tree_node*,
int, int)
../../gcc-source-trunk/gcc/cp/pt.c:9685
0x9b7bcd finish_template_type(tree_node*, tree_node*, int)
../../gcc-source-trunk/gcc/cp/semantics.c:3249
0x90c057 cp_parser_template_id
../../gcc-source-trunk/gcc/cp/parser.c:16295
0x90c254 cp_parser_class_name
../../gcc-source-trunk/gcc/cp/parser.c:22861
0x90e411 cp_parser_qualifying_entity
../../gcc-source-trunk/gcc/cp/parser.c:6651
0x90e411 cp_parser_nested_name_specifier_opt
../../gcc-source-trunk/gcc/cp/parser.c:6335
0x90f40a cp_parser_constructor_declarator_p
../../gcc-source-trunk/gcc/cp/parser.c:27029
0x90f40a cp_parser_decl_specifier_seq
../../gcc-source-trunk/gcc/cp/parser.c:13950
0x91a801 cp_parser_simple_declaration
../../gcc-source-trunk/gcc/cp/parser.c:13271
0x923b90 cp_parser_declaration
../../gcc-source-trunk/gcc/cp/parser.c:13087
0x922b05 cp_parser_translation_unit
../../gcc-source-trunk/gcc/cp/parser.c:4674
0x922b05 c_parse_file()
../../gcc-source-trunk/gcc/cp/parser.c:40680
0xa7e34a c_common_parse_file()
../../gcc-source-trunk/gcc/c-family/c-opts.c:1151
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
$
--------------------------------------
template < class A, A > struct B {};
struct C { C *c; };
B < C, &C::c > b;