public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/31038]  New: [4.1/4.2/4.3 regression] ICE with cast in initializer
@ 2007-03-04 21:27 reichelt at gcc dot gnu dot org
  2007-03-04 21:27 ` [Bug c++/31038] " reichelt at gcc dot gnu dot org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2007-03-04 21:27 UTC (permalink / raw)
  To: gcc-bugs

The following valid code snippet triggers an ICE since GCC 4.1.0:

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

template void foo<0>();
=============================

bug.cc: In function 'void foo() [with int <anonymous> = 0]':
bug.cc:6:   instantiated from here
bug.cc:3: internal compiler error: in tsubst_copy, at cp/pt.c:8342
Please submit a full bug report, [etc.]


-- 
           Summary: [4.1/4.2/4.3 regression] ICE with cast in initializer
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code, monitored
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: reichelt at gcc dot gnu dot org


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


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

* [Bug c++/31038] [4.1/4.2/4.3 regression] ICE with cast in initializer
  2007-03-04 21:27 [Bug c++/31038] New: [4.1/4.2/4.3 regression] ICE with cast in initializer reichelt at gcc dot gnu dot org
@ 2007-03-04 21:27 ` reichelt at gcc dot gnu dot org
  2007-03-04 22:00 ` [Bug c++/31038] [4.1/4.2/4.3 regression] ICE with C99 style compound literal vs templates vs instiaiontion pinskia at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2007-03-04 21:27 UTC (permalink / raw)
  To: gcc-bugs



-- 

reichelt at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.1.3


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


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

* [Bug c++/31038] [4.1/4.2/4.3 regression] ICE with C99 style compound literal vs templates vs instiaiontion
  2007-03-04 21:27 [Bug c++/31038] New: [4.1/4.2/4.3 regression] ICE with cast in initializer reichelt at gcc dot gnu dot org
  2007-03-04 21:27 ` [Bug c++/31038] " reichelt at gcc dot gnu dot org
@ 2007-03-04 22:00 ` pinskia at gcc dot gnu dot org
  2007-03-04 22:14 ` pinskia at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-03-04 22:00 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pinskia at gcc dot gnu dot org  2007-03-04 22:00 -------
I can fix the testcase here by optimizing when we produce a CLEANUP_POINT_EXPR
but the following testcase still fails at that point:

int f(void);
template<int> void foo()
{
  int i = (int) { f() };
}

template void foo<0>();


-- 

pinskia 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         |2007-03-04 22:00:04
               date|                            |


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


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

* [Bug c++/31038] [4.1/4.2/4.3 regression] ICE with C99 style compound literal vs templates vs instiaiontion
  2007-03-04 21:27 [Bug c++/31038] New: [4.1/4.2/4.3 regression] ICE with cast in initializer reichelt at gcc dot gnu dot org
  2007-03-04 21:27 ` [Bug c++/31038] " reichelt at gcc dot gnu dot org
  2007-03-04 22:00 ` [Bug c++/31038] [4.1/4.2/4.3 regression] ICE with C99 style compound literal vs templates vs instiaiontion pinskia at gcc dot gnu dot org
@ 2007-03-04 22:14 ` pinskia at gcc dot gnu dot org
  2007-03-05  4:14 ` mmitchel at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-03-04 22:14 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from pinskia at gcc dot gnu dot org  2007-03-04 22:14 -------
#8  0x0017dc54 in cp_parser_initializer_clause (parser=0x434e1dc0,
non_constant_p=0xbffff039 "") at ../../gcc/cp/parser.c:12954
12954           initializer = fold_non_dependent_expr (initializer);

And fold_non_dependent_expr sets processing_template_decl to false.


-- 


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


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

* [Bug c++/31038] [4.1/4.2/4.3 regression] ICE with C99 style compound literal vs templates vs instiaiontion
  2007-03-04 21:27 [Bug c++/31038] New: [4.1/4.2/4.3 regression] ICE with cast in initializer reichelt at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2007-03-04 22:14 ` pinskia at gcc dot gnu dot org
@ 2007-03-05  4:14 ` mmitchel at gcc dot gnu dot org
  2007-03-11 19:48 ` mmitchel at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2007-03-05  4:14 UTC (permalink / raw)
  To: gcc-bugs



-- 

mmitchel at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P1


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


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

* [Bug c++/31038] [4.1/4.2/4.3 regression] ICE with C99 style compound literal vs templates vs instiaiontion
  2007-03-04 21:27 [Bug c++/31038] New: [4.1/4.2/4.3 regression] ICE with cast in initializer reichelt at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2007-03-05  4:14 ` mmitchel at gcc dot gnu dot org
@ 2007-03-11 19:48 ` mmitchel at gcc dot gnu dot org
  2007-03-12  0:27 ` mmitchel at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2007-03-11 19:48 UTC (permalink / raw)
  To: gcc-bugs



-- 

mmitchel at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |mark at codesourcery dot com
                   |dot org                     |
             Status|NEW                         |ASSIGNED


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


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

* [Bug c++/31038] [4.1/4.2/4.3 regression] ICE with C99 style compound literal vs templates vs instiaiontion
  2007-03-04 21:27 [Bug c++/31038] New: [4.1/4.2/4.3 regression] ICE with cast in initializer reichelt at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2007-03-11 19:48 ` mmitchel at gcc dot gnu dot org
@ 2007-03-12  0:27 ` mmitchel at gcc dot gnu dot org
  2007-03-12  1:34 ` [Bug c++/31038] [4.1/4.2 " mmitchel at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2007-03-12  0:27 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from mmitchel at gcc dot gnu dot org  2007-03-12 00:26 -------
Subject: Bug 31038

Author: mmitchel
Date: Mon Mar 12 00:26:39 2007
New Revision: 122829

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=122829
Log:
        PR c++/30328
        * semantics.c (finish_typeof): Use unlowered_expr_type.

        PR c++/30328
        * g++.dg/ext/bitfield1.C: New test.

        PR c++/31038
        * parser.c (cp_parser_postfix_expression): Disallow compound
        literals in constant expressions.

        PR c++/31038
        * g++.dg/template/complit2.C: New test.

Added:
    trunk/gcc/testsuite/g++.dg/ext/bitfield1.C
    trunk/gcc/testsuite/g++.dg/template/complit2.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/parser.c
    trunk/gcc/cp/semantics.c
    trunk/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug c++/31038] [4.1/4.2 regression] ICE with C99 style compound literal vs templates vs instiaiontion
  2007-03-04 21:27 [Bug c++/31038] New: [4.1/4.2/4.3 regression] ICE with cast in initializer reichelt at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2007-03-12  0:27 ` mmitchel at gcc dot gnu dot org
@ 2007-03-12  1:34 ` mmitchel at gcc dot gnu dot org
  2007-03-12  1:53 ` mmitchel at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2007-03-12  1:34 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from mmitchel at gcc dot gnu dot org  2007-03-12 01:34 -------
Fixed in 4.3.0.


-- 

mmitchel at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[4.1/4.2/4.3 regression] ICE|[4.1/4.2 regression] ICE
                   |with C99 style compound     |with C99 style compound
                   |literal vs templates vs     |literal vs templates vs
                   |instiaiontion               |instiaiontion


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


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

* [Bug c++/31038] [4.1/4.2 regression] ICE with C99 style compound literal vs templates vs instiaiontion
  2007-03-04 21:27 [Bug c++/31038] New: [4.1/4.2/4.3 regression] ICE with cast in initializer reichelt at gcc dot gnu dot org
                   ` (6 preceding siblings ...)
  2007-03-12  1:34 ` [Bug c++/31038] [4.1/4.2 " mmitchel at gcc dot gnu dot org
@ 2007-03-12  1:53 ` mmitchel at gcc dot gnu dot org
  2008-05-28 23:55 ` [Bug c++/31038] [4.1 " pinskia at gcc dot gnu dot org
  2008-07-04 16:04 ` [Bug c++/31038] [4.1 regression] ICE with C99 style compound literal vs templates vs instantiation jsm28 at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2007-03-12  1:53 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from mmitchel at gcc dot gnu dot org  2007-03-12 01:52 -------
Subject: Bug 31038

Author: mmitchel
Date: Mon Mar 12 01:52:45 2007
New Revision: 122830

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=122830
Log:
        PR c++/31038
        * parser.c (cp_parser_postfix_expression): Disallow compound
        literals in constant expressions.

        PR c++/30328
        * semantics.c (finish_typeof): Use unlowered_expr_type.

        PR c++/31038
        * g++.dg/template/complit2.C: New test.

        PR c++/30328
        * g++.dg/ext/bitfield1.C: New test.

Added:
    branches/gcc-4_2-branch/gcc/testsuite/g++.dg/ext/bitfield1.C
    branches/gcc-4_2-branch/gcc/testsuite/g++.dg/template/complit2.C
Modified:
    branches/gcc-4_2-branch/gcc/cp/ChangeLog
    branches/gcc-4_2-branch/gcc/cp/parser.c
    branches/gcc-4_2-branch/gcc/cp/semantics.c
    branches/gcc-4_2-branch/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug c++/31038] [4.1 regression] ICE with C99 style compound literal vs templates vs instiaiontion
  2007-03-04 21:27 [Bug c++/31038] New: [4.1/4.2/4.3 regression] ICE with cast in initializer reichelt at gcc dot gnu dot org
                   ` (7 preceding siblings ...)
  2007-03-12  1:53 ` mmitchel at gcc dot gnu dot org
@ 2008-05-28 23:55 ` pinskia at gcc dot gnu dot org
  2008-07-04 16:04 ` [Bug c++/31038] [4.1 regression] ICE with C99 style compound literal vs templates vs instantiation jsm28 at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-05-28 23:55 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from pinskia at gcc dot gnu dot org  2008-05-28 23:54 -------
What caused this regression was the change of representation of CONSTRUCTOR.  I
can make this easy work with a simple patch which looks at values of the
CONSTRUCTOR.


-- 


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


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

* [Bug c++/31038] [4.1 regression] ICE with C99 style compound literal vs templates vs instantiation
  2007-03-04 21:27 [Bug c++/31038] New: [4.1/4.2/4.3 regression] ICE with cast in initializer reichelt at gcc dot gnu dot org
                   ` (8 preceding siblings ...)
  2008-05-28 23:55 ` [Bug c++/31038] [4.1 " pinskia at gcc dot gnu dot org
@ 2008-07-04 16:04 ` jsm28 at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: jsm28 at gcc dot gnu dot org @ 2008-07-04 16:04 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from jsm28 at gcc dot gnu dot org  2008-07-04 16:03 -------
Closing 4.1 branch.


-- 

jsm28 at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
      Known to fail|                            |4.1.3
      Known to work|4.3.0                       |4.2.0 4.3.0
         Resolution|                            |FIXED
   Target Milestone|4.1.3                       |4.2.0


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


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

end of thread, other threads:[~2008-07-04 16:04 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-03-04 21:27 [Bug c++/31038] New: [4.1/4.2/4.3 regression] ICE with cast in initializer reichelt at gcc dot gnu dot org
2007-03-04 21:27 ` [Bug c++/31038] " reichelt at gcc dot gnu dot org
2007-03-04 22:00 ` [Bug c++/31038] [4.1/4.2/4.3 regression] ICE with C99 style compound literal vs templates vs instiaiontion pinskia at gcc dot gnu dot org
2007-03-04 22:14 ` pinskia at gcc dot gnu dot org
2007-03-05  4:14 ` mmitchel at gcc dot gnu dot org
2007-03-11 19:48 ` mmitchel at gcc dot gnu dot org
2007-03-12  0:27 ` mmitchel at gcc dot gnu dot org
2007-03-12  1:34 ` [Bug c++/31038] [4.1/4.2 " mmitchel at gcc dot gnu dot org
2007-03-12  1:53 ` mmitchel at gcc dot gnu dot org
2008-05-28 23:55 ` [Bug c++/31038] [4.1 " pinskia at gcc dot gnu dot org
2008-07-04 16:04 ` [Bug c++/31038] [4.1 regression] ICE with C99 style compound literal vs templates vs instantiation jsm28 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).