public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/52467] New: ICE: canonical types differ for int [0] and int [0]
@ 2012-03-03 13:45 mg200 at uni dot brighton.ac.uk
  2012-03-03 14:01 ` [Bug c++/52467] " daniel.kruegler at googlemail dot com
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: mg200 at uni dot brighton.ac.uk @ 2012-03-03 13:45 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 52467
           Summary: ICE: canonical types differ for int [0] and int [0]
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: mg200@uni.brighton.ac.uk


Created attachment 26815
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=26815
Minimal test case

I'm not sure if an array of 0 elements is actually legal, but I get an ICE
compiling the attached test case:

$ g++ array-0.cpp 
array-0.cpp:6:6: internal compiler error: canonical types differ for identical
types int [0] and int [0]


Works if a is defined as "int a[0] = {};".


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

* [Bug c++/52467] ICE: canonical types differ for int [0] and int [0]
  2012-03-03 13:45 [Bug c++/52467] New: ICE: canonical types differ for int [0] and int [0] mg200 at uni dot brighton.ac.uk
@ 2012-03-03 14:01 ` daniel.kruegler at googlemail dot com
  2012-03-05 10:40 ` rguenth at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: daniel.kruegler at googlemail dot com @ 2012-03-03 14:01 UTC (permalink / raw)
  To: gcc-bugs

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

Daniel Krügler <daniel.kruegler at googlemail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |daniel.kruegler at
                   |                            |googlemail dot com

--- Comment #1 from Daniel Krügler <daniel.kruegler at googlemail dot com> 2012-03-03 14:01:02 UTC ---
An array of length 0 is not valid. [dcl.array] p1:

"If the constant-expression (5.19) is present, it shall be an integral constant
expression and its value shall be greater than zero."

Thus accepting

int a[0] = {};

or any such variant is a compiler defect.


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

* [Bug c++/52467] ICE: canonical types differ for int [0] and int [0]
  2012-03-03 13:45 [Bug c++/52467] New: ICE: canonical types differ for int [0] and int [0] mg200 at uni dot brighton.ac.uk
  2012-03-03 14:01 ` [Bug c++/52467] " daniel.kruegler at googlemail dot com
@ 2012-03-05 10:40 ` rguenth at gcc dot gnu.org
  2012-03-05 11:14 ` redi at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-03-05 10:40 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |WAITING
   Last reconfirmed|                            |2012-03-05
     Ever Confirmed|0                           |1

--- Comment #2 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-03-05 10:39:44 UTC ---
Works for me on the 4.7 branch and on trunk.  Note that it requires -std=c++11
because of the constexpr use.

Can you clarify the target and command-line options you use?


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

* [Bug c++/52467] ICE: canonical types differ for int [0] and int [0]
  2012-03-03 13:45 [Bug c++/52467] New: ICE: canonical types differ for int [0] and int [0] mg200 at uni dot brighton.ac.uk
  2012-03-03 14:01 ` [Bug c++/52467] " daniel.kruegler at googlemail dot com
  2012-03-05 10:40 ` rguenth at gcc dot gnu.org
@ 2012-03-05 11:14 ` redi at gcc dot gnu.org
  2012-03-05 14:15 ` mg200 at uni dot brighton.ac.uk
  2013-05-04 16:33 ` paolo.carlini at oracle dot com
  4 siblings, 0 replies; 6+ messages in thread
From: redi at gcc dot gnu.org @ 2012-03-05 11:14 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-03-05 11:14:03 UTC ---
(In reply to comment #1)
> or any such variant is a compiler defect.

It's a GNU extension and is rejected with -pedantic-errors  (and compiles
without ICE otherwise)

(In reply to comment #2)
> Can you clarify the target and command-line options you use?

And exact version, i.e. output of g++ -v

Basically all the info requested by http://gcc.gnu.org/bugs/ which should have
been provided anyway


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

* [Bug c++/52467] ICE: canonical types differ for int [0] and int [0]
  2012-03-03 13:45 [Bug c++/52467] New: ICE: canonical types differ for int [0] and int [0] mg200 at uni dot brighton.ac.uk
                   ` (2 preceding siblings ...)
  2012-03-05 11:14 ` redi at gcc dot gnu.org
@ 2012-03-05 14:15 ` mg200 at uni dot brighton.ac.uk
  2013-05-04 16:33 ` paolo.carlini at oracle dot com
  4 siblings, 0 replies; 6+ messages in thread
From: mg200 at uni dot brighton.ac.uk @ 2012-03-05 14:15 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Martin Griffin <mg200 at uni dot brighton.ac.uk> 2012-03-05 14:14:45 UTC ---
(In reply to comment #3)
> (In reply to comment #2)
> > Can you clarify the target and command-line options you use?
> 
> And exact version, i.e. output of g++ -v

$ g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/x86_64-unknown-linux-gnu/4.7.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../gcc/configure : (reconfigured) ../gcc/configure :
(reconfigured) ../gcc/configure
Thread model: posix
gcc version 4.7.0 20120214 (experimental) (GCC) 


> Basically all the info requested by http://gcc.gnu.org/bugs/ which should have
> been provided anyway

Sorry.


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

* [Bug c++/52467] ICE: canonical types differ for int [0] and int [0]
  2012-03-03 13:45 [Bug c++/52467] New: ICE: canonical types differ for int [0] and int [0] mg200 at uni dot brighton.ac.uk
                   ` (3 preceding siblings ...)
  2012-03-05 14:15 ` mg200 at uni dot brighton.ac.uk
@ 2013-05-04 16:33 ` paolo.carlini at oracle dot com
  4 siblings, 0 replies; 6+ messages in thread
From: paolo.carlini at oracle dot com @ 2013-05-04 16:33 UTC (permalink / raw)
  To: gcc-bugs


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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |RESOLVED
      Known to work|                            |4.7.3, 4.8.0, 4.9.0
         Resolution|                            |WORKSFORME

--- Comment #5 from Paolo Carlini <paolo.carlini at oracle dot com> 2013-05-04 16:33:00 UTC ---
Closing.


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

end of thread, other threads:[~2013-05-04 16:33 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-03 13:45 [Bug c++/52467] New: ICE: canonical types differ for int [0] and int [0] mg200 at uni dot brighton.ac.uk
2012-03-03 14:01 ` [Bug c++/52467] " daniel.kruegler at googlemail dot com
2012-03-05 10:40 ` rguenth at gcc dot gnu.org
2012-03-05 11:14 ` redi at gcc dot gnu.org
2012-03-05 14:15 ` mg200 at uni dot brighton.ac.uk
2013-05-04 16:33 ` 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).