http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58504
Bug ID: 58504 Summary: ICE with type trait as default template parameter Product: gcc Version: 4.9.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: reichelt at gcc dot gnu.org The following valid code snippet triggers an ICE since GCC 4.6.0: ============================================================= template<bool = __has_nothrow_assign(void)> struct A {}; A<> a; ============================================================= bug.cc:3:3: internal compiler error: in tsubst_copy, at cp/pt.c:12809 A<> a; ^ 0x5b2723 tsubst_copy ../../gcc/gcc/cp/pt.c:12809 0x591061 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool, bool) ../../gcc/gcc/cp/pt.c:14738 0x59a4e2 tsubst_expr ../../gcc/gcc/cp/pt.c:13628 0x5a755d tsubst_template_arg ../../gcc/gcc/cp/pt.c:9235 0x5a3449 coerce_template_parms ../../gcc/gcc/cp/pt.c:6802 0x5abc6a lookup_template_class_1 ../../gcc/gcc/cp/pt.c:7398 0x5abc6a lookup_template_class(tree_node*, tree_node*, tree_node*, tree_node*, int, int) ../../gcc/gcc/cp/pt.c:7695 0x6ad202 finish_template_type(tree_node*, tree_node*, int) ../../gcc/gcc/cp/semantics.c:2856 0x6456c0 cp_parser_template_id ../../gcc/gcc/cp/parser.c:13218 0x6458d2 cp_parser_class_name ../../gcc/gcc/cp/parser.c:18746 0x63b5ef cp_parser_qualifying_entity ../../gcc/gcc/cp/parser.c:5448 0x63b5ef cp_parser_nested_name_specifier_opt ../../gcc/gcc/cp/parser.c:5173 0x6462b7 cp_parser_constructor_declarator_p ../../gcc/gcc/cp/parser.c:22076 0x6462b7 cp_parser_decl_specifier_seq ../../gcc/gcc/cp/parser.c:11313 0x64a1a9 cp_parser_simple_declaration ../../gcc/gcc/cp/parser.c:10918 0x64c1b0 cp_parser_block_declaration ../../gcc/gcc/cp/parser.c:10867 0x6551ce cp_parser_declaration ../../gcc/gcc/cp/parser.c:10764 0x653f2d cp_parser_declaration_seq_opt ../../gcc/gcc/cp/parser.c:10650 0x655806 cp_parser_translation_unit ../../gcc/gcc/cp/parser.c:3939 0x655806 c_parse_file() ../../gcc/gcc/cp/parser.c:28893 Please submit a full bug report, [etc.]