public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/59115] New: [c++1y] ICE with auto as template parameter
@ 2013-11-13 14:43 reichelt at gcc dot gnu.org
  2013-11-24 17:55 ` [Bug c++/59115] " adam at jessamine dot co.uk
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: reichelt at gcc dot gnu.org @ 2013-11-13 14:43 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 59115
           Summary: [c++1y] ICE with auto as 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 invalid code snippet (compiled with "-std=c++1y") triggers an ICE
on trunk:

===============================================================
template<typename T, auto, int = 0> void foo(T, auto) {}

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

bug.cc:1:22: error: 'auto' parameter not permitted in this context
 template<typename T, auto, int = 0> void foo(T, auto) {}
                      ^
bug.cc: In substitution of 'template<class T, <declaration error>, int
<anonymous>, class auto:1> void foo(T, auto:1) [with T = int; <declaration
error> = <missing>; int <anonymous> = <missing>; auto:1 = <missing>]':
bug.cc:5:11:   required from here
bug.cc:5:11: internal compiler error: in unify, at cp/pt.c:17279
   foo(0, 0);
           ^
0x5d5e3d unify
        ../../gcc/gcc/cp/pt.c:17279
0x5de566 unify_one_argument
        ../../gcc/gcc/cp/pt.c:16102
0x5d3493 type_unification_real
        ../../gcc/gcc/cp/pt.c:16174
0x5e225e 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:15615
0x54d05c add_template_candidate_real
        ../../gcc/gcc/cp/call.c:2923
0x548ce9 add_template_candidate
        ../../gcc/gcc/cp/call.c:3020
0x548ce9 add_candidates
        ../../gcc/gcc/cp/call.c:5075
0x550062 perform_overload_resolution
        ../../gcc/gcc/cp/call.c:3816
0x556b5a build_new_function_call(tree_node*, vec<tree_node*, va_gc,
vl_embed>**, bool, int)
        ../../gcc/gcc/cp/call.c:3893
0x6cc2d0 finish_call_expr(tree_node*, vec<tree_node*, va_gc, vl_embed>**, bool,
bool, int)
        ../../gcc/gcc/cp/semantics.c:2274
0x652023 cp_parser_postfix_expression
        ../../gcc/gcc/cp/parser.c:6094
0x6548cd cp_parser_unary_expression
        ../../gcc/gcc/cp/parser.c:7100
0x65543f cp_parser_binary_expression
        ../../gcc/gcc/cp/parser.c:7804
0x65590f cp_parser_assignment_expression
        ../../gcc/gcc/cp/parser.c:8042
0x657e63 cp_parser_expression
        ../../gcc/gcc/cp/parser.c:8204
0x65865e cp_parser_expression
        ../../gcc/gcc/cp/parser.c:8243
0x65865e cp_parser_expression_statement
        ../../gcc/gcc/cp/parser.c:9542
0x64df67 cp_parser_statement
        ../../gcc/gcc/cp/parser.c:9393
0x64ec49 cp_parser_statement_seq_opt
        ../../gcc/gcc/cp/parser.c:9665
0x64edbe cp_parser_compound_statement
        ../../gcc/gcc/cp/parser.c:9619
Please submit a full bug report, [etc.]


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

* [Bug c++/59115] [c++1y] ICE with auto as template parameter
  2013-11-13 14:43 [Bug c++/59115] New: [c++1y] ICE with auto as template parameter reichelt at gcc dot gnu.org
@ 2013-11-24 17:55 ` adam at jessamine dot co.uk
  2013-12-19 15:20 ` [Bug c++/59115] [4.7/4.8/4.9 Regression] ICE with invalid " rguenth at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: adam at jessamine dot co.uk @ 2013-11-24 17:55 UTC (permalink / raw)
  To: gcc-bugs

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

Adam Butcher <adam at jessamine dot co.uk> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |adam at jessamine dot co.uk

--- Comment #1 from Adam Butcher <adam at jessamine dot co.uk> ---
The same ICE occurs without the use of 'auto'.  Modifying the testcase from

  template<typename T, auto, int = 0> void foo(T, auto) {}

to either

  template<typename T, float, int = 0> void foo(T, auto) {} 

or

  template<typename T, float, int = 0, typename X> void foo(T, X) {}

causes the same backtrace.  The default 0 for the int parm is also not
significant.  The ICE seems to be caused whenever an error_mark_node is left in
the template parameter list for whatever reason.  Looks like 4.8 used to bail
early in that case ("confused by earlier errors, bailing out").


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

* [Bug c++/59115] [4.7/4.8/4.9 Regression] ICE with invalid template parameter
  2013-11-13 14:43 [Bug c++/59115] New: [c++1y] ICE with auto as template parameter reichelt at gcc dot gnu.org
  2013-11-24 17:55 ` [Bug c++/59115] " adam at jessamine dot co.uk
@ 2013-12-19 15:20 ` rguenth at gcc dot gnu.org
  2013-12-19 15:33 ` rguenth at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2013-12-19 15:20 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.7.4


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

* [Bug c++/59115] [4.7/4.8/4.9 Regression] ICE with invalid template parameter
  2013-11-13 14:43 [Bug c++/59115] New: [c++1y] ICE with auto as template parameter reichelt at gcc dot gnu.org
  2013-11-24 17:55 ` [Bug c++/59115] " adam at jessamine dot co.uk
  2013-12-19 15:20 ` [Bug c++/59115] [4.7/4.8/4.9 Regression] ICE with invalid " rguenth at gcc dot gnu.org
@ 2013-12-19 15:33 ` rguenth at gcc dot gnu.org
  2014-04-08  1:27 ` paolo.carlini at oracle dot com
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2013-12-19 15:33 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P5


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

* [Bug c++/59115] [4.7/4.8/4.9 Regression] ICE with invalid template parameter
  2013-11-13 14:43 [Bug c++/59115] New: [c++1y] ICE with auto as template parameter reichelt at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2013-12-19 15:33 ` rguenth at gcc dot gnu.org
@ 2014-04-08  1:27 ` paolo.carlini at oracle dot com
  2014-04-09  0:10 ` paolo at gcc dot gnu.org
  2014-04-09  0:11 ` paolo.carlini at oracle dot com
  5 siblings, 0 replies; 7+ messages in thread
From: paolo.carlini at oracle dot com @ 2014-04-08  1:27 UTC (permalink / raw)
  To: gcc-bugs

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

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2014-04-08
           Assignee|unassigned at gcc dot gnu.org      |paolo.carlini at oracle dot com
     Ever confirmed|0                           |1

--- Comment #3 from Paolo Carlini <paolo.carlini at oracle dot com> ---
Mine.


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

* [Bug c++/59115] [4.7/4.8/4.9 Regression] ICE with invalid template parameter
  2013-11-13 14:43 [Bug c++/59115] New: [c++1y] ICE with auto as template parameter reichelt at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2014-04-08  1:27 ` paolo.carlini at oracle dot com
@ 2014-04-09  0:10 ` paolo at gcc dot gnu.org
  2014-04-09  0:11 ` paolo.carlini at oracle dot com
  5 siblings, 0 replies; 7+ messages in thread
From: paolo at gcc dot gnu.org @ 2014-04-09  0:10 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from paolo at gcc dot gnu.org <paolo at gcc dot gnu.org> ---
Author: paolo
Date: Wed Apr  9 00:09:28 2014
New Revision: 209230

URL: http://gcc.gnu.org/viewcvs?rev=209230&root=gcc&view=rev
Log:
/cp
2014-04-08  Paolo Carlini  <paolo.carlini@oracle.com>

    PR c++/59115
    * pt.c (process_template_parm): For an invalid non-type parameter
    only set TREE_TYPE to error_mark_node.
    (push_inline_template_parms_recursive, comp_template_parms,
    redeclare_class_template, coerce_template_template_parm,
    coerce_template_template_parms, unify): Use error_operand_p.

/testsuite
2014-04-08  Paolo Carlini  <paolo.carlini@oracle.com>

    PR c++/59115
    * g++.dg/template/crash119.C: New.

Added:
    trunk/gcc/testsuite/g++.dg/template/crash119.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/pt.c
    trunk/gcc/testsuite/ChangeLog


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

* [Bug c++/59115] [4.7/4.8/4.9 Regression] ICE with invalid template parameter
  2013-11-13 14:43 [Bug c++/59115] New: [c++1y] ICE with auto as template parameter reichelt at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2014-04-09  0:10 ` paolo at gcc dot gnu.org
@ 2014-04-09  0:11 ` paolo.carlini at oracle dot com
  5 siblings, 0 replies; 7+ messages in thread
From: paolo.carlini at oracle dot com @ 2014-04-09  0:11 UTC (permalink / raw)
  To: gcc-bugs

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

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED
           Assignee|paolo.carlini at oracle dot com    |unassigned at gcc dot gnu.org
   Target Milestone|4.7.4                       |4.9.0

--- Comment #5 from Paolo Carlini <paolo.carlini at oracle dot com> ---
Fixed for 4.9.0.


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

end of thread, other threads:[~2014-04-09  0:11 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-13 14:43 [Bug c++/59115] New: [c++1y] ICE with auto as template parameter reichelt at gcc dot gnu.org
2013-11-24 17:55 ` [Bug c++/59115] " adam at jessamine dot co.uk
2013-12-19 15:20 ` [Bug c++/59115] [4.7/4.8/4.9 Regression] ICE with invalid " rguenth at gcc dot gnu.org
2013-12-19 15:33 ` rguenth at gcc dot gnu.org
2014-04-08  1:27 ` paolo.carlini at oracle dot com
2014-04-09  0:10 ` paolo at gcc dot gnu.org
2014-04-09  0:11 ` paolo.carlini at oracle dot com

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