Created attachment 26815 [details] 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] = {};".
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.
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?
(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
(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.
Closing.