public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/28641]  New: [4.1/4.2 regression] ICE calling template function with invalid template parameter
@ 2006-08-07 17:43 reichelt at gcc dot gnu dot org
  2006-08-07 17:45 ` [Bug c++/28641] " reichelt at gcc dot gnu dot org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2006-08-07 17:43 UTC (permalink / raw)
  To: gcc-bugs

The following invalid code snippet triggers an ICE on mainline and 4.1 branch:

===================================================
template<void> void foo();
void bar() { foo<0>(); }
===================================================

bug.cc:1: error: 'void' is not a valid type for a template constant parameter
bug.cc: In function 'void bar()':
bug.cc:2: internal compiler error: tree check: expected tree_list, have
error_mark in type_unification_real, at cp/pt.c:9791
Please submit a full bug report, [etc.]

This is fallout from PR 27668.


-- 
           Summary: [4.1/4.2 regression] ICE calling template function with
                    invalid template parameter
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Keywords: ice-on-invalid-code, error-recovery, monitored
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: reichelt at gcc dot gnu dot org
 BugsThisDependsOn: 27668


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


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

* [Bug c++/28641] [4.1/4.2 regression] ICE calling template function with invalid template parameter
  2006-08-07 17:43 [Bug c++/28641] New: [4.1/4.2 regression] ICE calling template function with invalid template parameter reichelt at gcc dot gnu dot org
@ 2006-08-07 17:45 ` reichelt at gcc dot gnu dot org
  2006-08-09 18:43 ` lmillward at gcc dot gnu dot org
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2006-08-07 17:45 UTC (permalink / raw)
  To: gcc-bugs



-- 

reichelt at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.1.2


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


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

* [Bug c++/28641] [4.1/4.2 regression] ICE calling template function with invalid template parameter
  2006-08-07 17:43 [Bug c++/28641] New: [4.1/4.2 regression] ICE calling template function with invalid template parameter reichelt at gcc dot gnu dot org
  2006-08-07 17:45 ` [Bug c++/28641] " reichelt at gcc dot gnu dot org
@ 2006-08-09 18:43 ` lmillward at gcc dot gnu dot org
  2006-08-09 18:47 ` lmillward at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: lmillward at gcc dot gnu dot org @ 2006-08-09 18:43 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from lmillward at gcc dot gnu dot org  2006-08-09 18:43 -------
Subject: Bug 28641

Author: lmillward
Date: Wed Aug  9 18:43:06 2006
New Revision: 116043

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=116043
Log:
2006-08-09  Lee Millward  <lee.millward@codesourcery.com>

       PR c++/28637
       * pt.c (coerce_template_parms): Copy across the
       invalid template arguments to the new template inner arguments.
       (retrieve_specialization): Robustify.

       * g++.dg/template/void3.C: New test.

       PR c++/28638
       * pt.c (coerce_template_template_parms): Robustify.

       * g++.dg/template/void4.C: New test.

       PR c++/28639
       * error.c (dump_template_parms): Robustify.

       PR c++/28640
       * pt.c (redeclare_class_template): Robustify

       * g++.dg/template/void5.C: New test.

       PR c++/28641
       * pt.c (type_unification_real): Robustify.


Added:
    trunk/gcc/testsuite/g++.dg/template/void3.C
    trunk/gcc/testsuite/g++.dg/template/void4.C
    trunk/gcc/testsuite/g++.dg/template/void5.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/error.c
    trunk/gcc/cp/pt.c
    trunk/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug c++/28641] [4.1/4.2 regression] ICE calling template function with invalid template parameter
  2006-08-07 17:43 [Bug c++/28641] New: [4.1/4.2 regression] ICE calling template function with invalid template parameter reichelt at gcc dot gnu dot org
  2006-08-07 17:45 ` [Bug c++/28641] " reichelt at gcc dot gnu dot org
  2006-08-09 18:43 ` lmillward at gcc dot gnu dot org
@ 2006-08-09 18:47 ` lmillward at gcc dot gnu dot org
  2006-08-10 19:20 ` lmillward at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: lmillward at gcc dot gnu dot org @ 2006-08-09 18:47 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from lmillward at gcc dot gnu dot org  2006-08-09 18:47 -------
Partially fixed on mainline, the testcase now ICE's in the same place as PR
24791. 


-- 


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


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

* [Bug c++/28641] [4.1/4.2 regression] ICE calling template function with invalid template parameter
  2006-08-07 17:43 [Bug c++/28641] New: [4.1/4.2 regression] ICE calling template function with invalid template parameter reichelt at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2006-08-09 18:47 ` lmillward at gcc dot gnu dot org
@ 2006-08-10 19:20 ` lmillward at gcc dot gnu dot org
  2006-08-10 19:25 ` [Bug c++/28641] [4.2 " lmillward at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: lmillward at gcc dot gnu dot org @ 2006-08-10 19:20 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from lmillward at gcc dot gnu dot org  2006-08-10 19:19 -------
Subject: Bug 28641

Author: lmillward
Date: Thu Aug 10 19:18:37 2006
New Revision: 116068

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=116068
Log:
        PR c++/28594
        PR c++/28637
        PR c++/28638
        PR c++/28639
        PR c++/28640
        PR c++/28641

        Revert:
        2006-07-28  Lee Millward  <lee.millward@codesourcery.com>

        PR c++/27668
        PR c++/27962
        * pt.c (process_template_parm) Store invalid template
        parameters as error_mark_node in the paramater list.
        (push_inline_template_parms_recursive): Handle invalid
        template parameters.
        (comp_template_parms): Likewise.
        (check_default_tmpl_args): Likewise.
        (coerce_template_template_parms): Likewise.
        (coerce_template_parms): Likewise.
        (mangle_class_name_for_template): Likewise.
        (tsubst_template_parms): Likewise.
        * error.c (dump_template_argument_list): Likewise.

        * g++.dg/template/crash54.C: New test.
        * g++.dg/template/nontype16.C: New test.
        * g++.dg/template/nontype5.C: Adjust error markers


Removed:
    branches/gcc-4_1-branch/gcc/testsuite/g++.dg/template/crash54.C
    branches/gcc-4_1-branch/gcc/testsuite/g++.dg/template/nontype16.C
Modified:
    branches/gcc-4_1-branch/gcc/cp/ChangeLog
    branches/gcc-4_1-branch/gcc/cp/error.c
    branches/gcc-4_1-branch/gcc/cp/pt.c
    branches/gcc-4_1-branch/gcc/testsuite/ChangeLog
    branches/gcc-4_1-branch/gcc/testsuite/g++.dg/template/nontype5.C


-- 


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


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

* [Bug c++/28641] [4.2 regression] ICE calling template function with invalid template parameter
  2006-08-07 17:43 [Bug c++/28641] New: [4.1/4.2 regression] ICE calling template function with invalid template parameter reichelt at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2006-08-10 19:20 ` lmillward at gcc dot gnu dot org
@ 2006-08-10 19:25 ` lmillward at gcc dot gnu dot org
  2006-08-10 20:33 ` pinskia at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: lmillward at gcc dot gnu dot org @ 2006-08-10 19:25 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from lmillward at gcc dot gnu dot org  2006-08-10 19:25 -------
Fixed on the 4.1 branch by the reversal of the patch for PR 27668 so removing
the 4.1 regression marker.


-- 

lmillward at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[4.1/4.2 regression] ICE    |[4.2 regression] ICE calling
                   |calling template function   |template function with
                   |with invalid template       |invalid template parameter
                   |parameter                   |


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


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

* [Bug c++/28641] [4.2 regression] ICE calling template function with invalid template parameter
  2006-08-07 17:43 [Bug c++/28641] New: [4.1/4.2 regression] ICE calling template function with invalid template parameter reichelt at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2006-08-10 19:25 ` [Bug c++/28641] [4.2 " lmillward at gcc dot gnu dot org
@ 2006-08-10 20:33 ` pinskia at gcc dot gnu dot org
  2006-08-15 18:35 ` reichelt at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-08-10 20:33 UTC (permalink / raw)
  To: gcc-bugs



-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.1.2                       |4.2.0


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


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

* [Bug c++/28641] [4.2 regression] ICE calling template function with invalid template parameter
  2006-08-07 17:43 [Bug c++/28641] New: [4.1/4.2 regression] ICE calling template function with invalid template parameter reichelt at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2006-08-10 20:33 ` pinskia at gcc dot gnu dot org
@ 2006-08-15 18:35 ` reichelt at gcc dot gnu dot org
  2006-08-20 22:32 ` mmitchel at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2006-08-15 18:35 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from reichelt at gcc dot gnu dot org  2006-08-15 18:35 -------
Confirmed as reproduced by Lee.


-- 

reichelt at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2006-08-15 18:35:40
               date|                            |


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


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

* [Bug c++/28641] [4.2 regression] ICE calling template function with invalid template parameter
  2006-08-07 17:43 [Bug c++/28641] New: [4.1/4.2 regression] ICE calling template function with invalid template parameter reichelt at gcc dot gnu dot org
                   ` (6 preceding siblings ...)
  2006-08-15 18:35 ` reichelt at gcc dot gnu dot org
@ 2006-08-20 22:32 ` mmitchel at gcc dot gnu dot org
  2006-08-29 19:07 ` lmillward at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2006-08-20 22:32 UTC (permalink / raw)
  To: gcc-bugs



-- 

mmitchel at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P4


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


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

* [Bug c++/28641] [4.2 regression] ICE calling template function with invalid template parameter
  2006-08-07 17:43 [Bug c++/28641] New: [4.1/4.2 regression] ICE calling template function with invalid template parameter reichelt at gcc dot gnu dot org
                   ` (7 preceding siblings ...)
  2006-08-20 22:32 ` mmitchel at gcc dot gnu dot org
@ 2006-08-29 19:07 ` lmillward at gcc dot gnu dot org
  2006-08-30  3:39 ` pinskia at gcc dot gnu dot org
  2006-08-30  4:41 ` pinskia at gcc dot gnu dot org
  10 siblings, 0 replies; 12+ messages in thread
From: lmillward at gcc dot gnu dot org @ 2006-08-29 19:07 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from lmillward at gcc dot gnu dot org  2006-08-29 19:07 -------
This doesn't ICE for me with current mainline:

bug.cc:1: error: 'void' is not a valid type for a template constant parameter
 void bar()
bug.cc:2: error: no matching function for call to 'foo()'

Can anyone else confirm this?


-- 


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


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

* [Bug c++/28641] [4.2 regression] ICE calling template function with invalid template parameter
  2006-08-07 17:43 [Bug c++/28641] New: [4.1/4.2 regression] ICE calling template function with invalid template parameter reichelt at gcc dot gnu dot org
                   ` (8 preceding siblings ...)
  2006-08-29 19:07 ` lmillward at gcc dot gnu dot org
@ 2006-08-30  3:39 ` pinskia at gcc dot gnu dot org
  2006-08-30  4:41 ` pinskia at gcc dot gnu dot org
  10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-08-30  3:39 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from pinskia at gcc dot gnu dot org  2006-08-30 03:39 -------
Been fixed since at least "4.2.0 20060826".


-- 


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


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

* [Bug c++/28641] [4.2 regression] ICE calling template function with invalid template parameter
  2006-08-07 17:43 [Bug c++/28641] New: [4.1/4.2 regression] ICE calling template function with invalid template parameter reichelt at gcc dot gnu dot org
                   ` (9 preceding siblings ...)
  2006-08-30  3:39 ` pinskia at gcc dot gnu dot org
@ 2006-08-30  4:41 ` pinskia at gcc dot gnu dot org
  10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-08-30  4:41 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from pinskia at gcc dot gnu dot org  2006-08-30 04:41 -------
I had meant to close this as fixed the last time.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pinskia at gcc dot gnu dot
                   |                            |org
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


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


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

end of thread, other threads:[~2006-08-30  4:41 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-08-07 17:43 [Bug c++/28641] New: [4.1/4.2 regression] ICE calling template function with invalid template parameter reichelt at gcc dot gnu dot org
2006-08-07 17:45 ` [Bug c++/28641] " reichelt at gcc dot gnu dot org
2006-08-09 18:43 ` lmillward at gcc dot gnu dot org
2006-08-09 18:47 ` lmillward at gcc dot gnu dot org
2006-08-10 19:20 ` lmillward at gcc dot gnu dot org
2006-08-10 19:25 ` [Bug c++/28641] [4.2 " lmillward at gcc dot gnu dot org
2006-08-10 20:33 ` pinskia at gcc dot gnu dot org
2006-08-15 18:35 ` reichelt at gcc dot gnu dot org
2006-08-20 22:32 ` mmitchel at gcc dot gnu dot org
2006-08-29 19:07 ` lmillward at gcc dot gnu dot org
2006-08-30  3:39 ` pinskia at gcc dot gnu dot org
2006-08-30  4:41 ` pinskia at gcc dot gnu dot 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).