public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/60627] New: [c++1y] ICE in explicit template instantiation containing auto parameter
@ 2014-03-23 19:47 reichelt at gcc dot gnu.org
  2014-03-24 20:40 ` [Bug c++/60627] " abutcher at gcc dot gnu.org
  2014-03-24 20:43 ` abutcher at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: reichelt at gcc dot gnu.org @ 2014-03-23 19:47 UTC (permalink / raw)
  To: gcc-bugs

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.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-03-24 20:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-23 19:47 [Bug c++/60627] New: [c++1y] ICE in explicit template instantiation containing auto parameter reichelt at gcc dot gnu.org
2014-03-24 20:40 ` [Bug c++/60627] " abutcher at gcc dot gnu.org
2014-03-24 20:43 ` abutcher at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).