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

* [Bug c++/60627] [c++1y] ICE in explicit template instantiation containing auto parameter
  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 ` abutcher at gcc dot gnu.org
  2014-03-24 20:43 ` abutcher at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: abutcher at gcc dot gnu.org @ 2014-03-24 20:40 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Adam Butcher <abutcher at gcc dot gnu.org> ---
Author: abutcher
Date: Mon Mar 24 20:40:15 2014
New Revision: 208799

URL: http://gcc.gnu.org/viewcvs?rev=208799&root=gcc&view=rev
Log:
Fix PR c++/60627

    PR c++/60627
    * parser.c (cp_parser_parameter_declaration_clause): Prevent 'auto' from
    introducing an implicit function template parameter within an explicit
    instantiation.

    PR c++/60627
    * g++.dg/cpp1y/pr60627.C: New testcase.

Added:
    trunk/gcc/testsuite/g++.dg/cpp1y/pr60627.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/parser.c
    trunk/gcc/testsuite/ChangeLog


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

* [Bug c++/60627] [c++1y] ICE in explicit template instantiation containing auto parameter
  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
  1 sibling, 0 replies; 3+ messages in thread
From: abutcher at gcc dot gnu.org @ 2014-03-24 20:43 UTC (permalink / raw)
  To: gcc-bugs

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

Adam Butcher <abutcher at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |FIXED
           Assignee|unassigned at gcc dot gnu.org      |abutcher at gcc dot gnu.org
   Target Milestone|---                         |4.9.0

--- Comment #2 from Adam Butcher <abutcher at gcc dot gnu.org> ---
Fixed in 4.9.


^ 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).