http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60627

            Bug ID: 60627
           Summary: [c++1y] ICE in explicit template instantiation
                    containing auto parameter
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Keywords: diagnostic, error-recovery, ice-on-invalid-code
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: reichelt at gcc dot gnu.org
                CC: abutcher at gcc dot gnu.org

The following invalid code snippet (compiled with "-std=c++1y")
triggers an ICE on trunk:

=========================================
template<typename T> void foo(T) {}

template void foo(auto);

void bar()
{
  foo(0);
}
=========================================

bug.cc:3:23: error: template parameter list used in explicit instantiation
 template void foo(auto);
                       ^
bug.cc: In instantiation of 'void foo(T) [with T = auto:1]':
bug.cc:3:23:   required from here
bug.cc:1:27: internal compiler error: in dependent_type_p, at cp/pt.c:20474
 template<typename T> void foo(T) {}
                           ^
0x602058 dependent_type_p(tree_node*)
        ../../gcc/gcc/cp/pt.c:20474
0x5d6450 require_complete_types_for_parms
        ../../gcc/gcc/cp/decl.c:10864
0x5d6450 check_function_type
        ../../gcc/gcc/cp/decl.c:12981
0x5d6450 start_preparsed_function(tree_node*, tree_node*, int)
        ../../gcc/gcc/cp/decl.c:13155
0x611ab0 instantiate_decl(tree_node*, int, bool)
        ../../gcc/gcc/cp/pt.c:19837
0x651427 instantiate_pending_templates(int)
        ../../gcc/gcc/cp/pt.c:19997
0x68c37f cp_write_global_declarations()
        ../../gcc/gcc/cp/decl2.c:4311
Please submit a full bug report, [etc.]

Also, the first diagnostic could be improved: It's not obvious that auto is a
template-parameter-list (and in other contexts it really isn't).

Adam, you might want to have a look at this one.

Reply via email to