https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67257

Markus Trippelsdorf <trippels at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice-on-invalid-code
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2015-08-18
                 CC|                            |trippels at gcc dot gnu.org
            Summary|Internal compiler error in  |[5/6 regression] Internal
                   |retrieve_specialization     |compiler error in
                   |                            |retrieve_specialization
     Ever confirmed|0                           |1

--- Comment #1 from Markus Trippelsdorf <trippels at gcc dot gnu.org> ---
It is an ICE on invalid:

 % cat Matrix.ii
template <typename> struct plus;
template <typename> struct A {
  template <typename T> auto operator()(T);
} foldl;
void foo() { foldl<plus<int>>(0); }

 % /var/tmp/gcc_test/usr/local/bin/g++ -c Matrix.ii
Matrix.ii: In substitution of ‘template<class> template<class T> auto
A::operator()(T) [with T = <missing>; <template-parameter-1-1> = int]’:
Matrix.ii:5:32:   required from here
Matrix.ii:5:32: internal compiler error: in retrieve_specialization, at
cp/pt.c:1194
 void foo() { foldl<plus<int>>(0); }
                                ^
0x5e0c73 retrieve_specialization
        ../../gcc/gcc/cp/pt.c:1191
0x5e568e instantiate_template_1
        ../../gcc/gcc/cp/pt.c:16561
0x5e568e instantiate_template(tree_node*, tree_node*, int)
        ../../gcc/gcc/cp/pt.c:16675
0x5fa689 fn_type_unification(tree_node*, tree_node*, tree_node*, tree_node*
const*, unsigned int, tree_node*, unification_kind_t, int, bool, bool)
        ../../gcc/gcc/cp/pt.c:17024
0x5b3cf9 add_template_candidate_real
        ../../gcc/gcc/cp/call.c:3065
0x5b437c add_template_candidate
        ../../gcc/gcc/cp/call.c:3162
0x5b437c add_candidates
        ../../gcc/gcc/cp/call.c:5318
0x5b8527 build_op_call_1
        ../../gcc/gcc/cp/call.c:4305
0x5b8527 build_op_call(tree_node*, vec<tree_node*, va_gc, vl_embed>**, int)
        ../../gcc/gcc/cp/call.c:4392
0x688568 finish_call_expr(tree_node*, vec<tree_node*, va_gc, vl_embed>**, bool,
bool, int)
        ../../gcc/gcc/cp/semantics.c:2408
0x63cde8 cp_parser_postfix_expression
        ../../gcc/gcc/cp/parser.c:6422
0x640d29 cp_parser_unary_expression
        ../../gcc/gcc/cp/parser.c:7486
0x6418a7 cp_parser_binary_expression
        ../../gcc/gcc/cp/parser.c:8223
0x641e7d cp_parser_assignment_expression
        ../../gcc/gcc/cp/parser.c:8481
0x6488f1 cp_parser_expression
        ../../gcc/gcc/cp/parser.c:8635
0x64a0f6 cp_parser_expression_statement
        ../../gcc/gcc/cp/parser.c:10049
0x639365 cp_parser_statement
        ../../gcc/gcc/cp/parser.c:9900
0x639e42 cp_parser_statement_seq_opt
        ../../gcc/gcc/cp/parser.c:10172
0x639f73 cp_parser_compound_statement
        ../../gcc/gcc/cp/parser.c:10126
0x652c5d cp_parser_function_body
        ../../gcc/gcc/cp/parser.c:19783
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.

markus@x4 tmp % /usr/x86_64-pc-linux-gnu/gcc-bin/4.9.3/g++ -std=c++14 -c
Matrix.ii
Matrix.ii:4:3: error: template declaration of ‘A< <template-parameter-1-1> >
foldl’
 } foldl;
   ^
Matrix.ii: In function ‘void foo()’:
Matrix.ii:5:14: error: ‘foldl’ was not declared in this scope
 void foo() { foldl<plus<int>>(0); }
              ^
Matrix.ii:5:28: error: expected primary-expression before ‘>’ token
 void foo() { foldl<plus<int>>(0); }
                            ^

Reply via email to