For the follwoing code snippet a bogus diagnostic is emitted since GCC 4.1.0: ================================ int main() { int a[2] = { 2, 3 }; int b[2] = a; } ================================ bug.cc: In function 'int main()': bug.cc:4: error: cannot convert 'int [2]' to 'int [2]' in initialization This message is confusing since transforming int[2] into int[2] shouldn't be hard. The problem is that you cannot use an array for initialization at all. Before we got: bug.cc: In function 'int main()': bug.cc:4: error: invalid initializer which is not too helpful, but at least correct.
Confirmed.
Will not be fixed in 4.1.1; adjust target milestone to 4.1.2.
Subject: Bug 26884 Author: shinwell Date: Wed Oct 18 10:57:18 2006 New Revision: 117854 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=117854 Log: PR c++/26884 * typeck2.c (digest_init): Raise error upon attempts to initialize arrays with variables. Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/typeck2.c
Subject: Bug 26884 Author: shinwell Date: Wed Oct 18 10:57:37 2006 New Revision: 117855 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=117855 Log: PR c++/26884 * typeck2.c (digest_init): Raise error upon attempts to initialize arrays with variables. Modified: branches/gcc-4_1-branch/gcc/cp/ChangeLog branches/gcc-4_1-branch/gcc/cp/typeck2.c
Fixed in mainline and 4.1 (revs 117854 and 117855 respectively).