public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/28248]  New: [4.1/4.2 regression] Trouble with invalid initializers
@ 2006-07-04 16:27 reichelt at gcc dot gnu dot org
  2006-07-04 17:06 ` [Bug c++/28248] " pinskia at gcc dot gnu dot org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2006-07-04 16:27 UTC (permalink / raw)
  To: gcc-bugs

The following invalid code snippet causes an ICE since GCC 4.1.0:

=================================
union A { char c; };

template<int> void foo()
{
  (A) { 0, 0 };
}

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

  bug.cc: In function 'void foo() [with int <anonymous> = 0]':
  bug.cc:10:   instantiated from here
  bug.cc:5: internal compiler error: in process_init_constructor_union, at
cp/typeck2.c:972
  Please submit a full bug report, [etc.]

If I replace "union" by "struct" the code compiles without error-message
or warning. Without the template the code triggers an error message in both
cases:

  bug.cc: In function 'void foo()':
  bug.cc:5: error: too many initializers for 'A'

Before GCC 4.1.0 the code triggered a pedwarn (and compiled without
problems with -fpermissive).


-- 
           Summary: [4.1/4.2 regression] Trouble with invalid initializers
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Keywords: ice-on-invalid-code, accepts-invalid, 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=28248


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

* [Bug c++/28248] [4.1/4.2 regression] Trouble with invalid initializers
  2006-07-04 16:27 [Bug c++/28248] New: [4.1/4.2 regression] Trouble with invalid initializers reichelt at gcc dot gnu dot org
@ 2006-07-04 17:06 ` pinskia at gcc dot gnu dot org
  2006-07-17  3:04 ` mmitchel at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-07-04 17:06 UTC (permalink / raw)
  To: gcc-bugs



-- 

pinskia at gcc dot gnu dot org changed:

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


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


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

* [Bug c++/28248] [4.1/4.2 regression] Trouble with invalid initializers
  2006-07-04 16:27 [Bug c++/28248] New: [4.1/4.2 regression] Trouble with invalid initializers reichelt at gcc dot gnu dot org
  2006-07-04 17:06 ` [Bug c++/28248] " pinskia at gcc dot gnu dot org
@ 2006-07-17  3:04 ` mmitchel at gcc dot gnu dot org
  2006-08-16  6:52 ` pinskia at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2006-07-17  3:04 UTC (permalink / raw)
  To: gcc-bugs



-- 

mmitchel at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P2


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


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

* [Bug c++/28248] [4.1/4.2 regression] Trouble with invalid initializers
  2006-07-04 16:27 [Bug c++/28248] New: [4.1/4.2 regression] Trouble with invalid initializers reichelt at gcc dot gnu dot org
  2006-07-04 17:06 ` [Bug c++/28248] " pinskia at gcc dot gnu dot org
  2006-07-17  3:04 ` mmitchel at gcc dot gnu dot org
@ 2006-08-16  6:52 ` pinskia at gcc dot gnu dot org
  2006-08-25 13:13 ` shinwell at gcc dot gnu dot org
  2006-10-17 17:30 ` shinwell at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-08-16  6:52 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pinskia at gcc dot gnu dot org  2006-08-16 06:52 -------
Confirmed.


-- 

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         |2006-08-16 06:52:05
               date|                            |


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


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

* [Bug c++/28248] [4.1/4.2 regression] Trouble with invalid initializers
  2006-07-04 16:27 [Bug c++/28248] New: [4.1/4.2 regression] Trouble with invalid initializers reichelt at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2006-08-16  6:52 ` pinskia at gcc dot gnu dot org
@ 2006-08-25 13:13 ` shinwell at gcc dot gnu dot org
  2006-10-17 17:30 ` shinwell at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: shinwell at gcc dot gnu dot org @ 2006-08-25 13:13 UTC (permalink / raw)
  To: gcc-bugs



-- 

shinwell at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |shinwell at gcc dot gnu dot
                   |dot org                     |org
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2006-08-16 06:52:05         |2006-08-25 13:13:18
               date|                            |


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


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

* [Bug c++/28248] [4.1/4.2 regression] Trouble with invalid initializers
  2006-07-04 16:27 [Bug c++/28248] New: [4.1/4.2 regression] Trouble with invalid initializers reichelt at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2006-08-25 13:13 ` shinwell at gcc dot gnu dot org
@ 2006-10-17 17:30 ` shinwell at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: shinwell at gcc dot gnu dot org @ 2006-10-17 17:30 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from shinwell at gcc dot gnu dot org  2006-10-17 17:30 -------


*** This bug has been marked as a duplicate of 27270 ***


-- 

shinwell at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |DUPLICATE


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


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

end of thread, other threads:[~2006-10-17 17:30 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-07-04 16:27 [Bug c++/28248] New: [4.1/4.2 regression] Trouble with invalid initializers reichelt at gcc dot gnu dot org
2006-07-04 17:06 ` [Bug c++/28248] " pinskia at gcc dot gnu dot org
2006-07-17  3:04 ` mmitchel at gcc dot gnu dot org
2006-08-16  6:52 ` pinskia at gcc dot gnu dot org
2006-08-25 13:13 ` shinwell at gcc dot gnu dot org
2006-10-17 17:30 ` shinwell 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).