This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/26884] New: [4.1/4.2 regression] Misleading diagnostic for invalid array initializer
- From: "reichelt at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 27 Mar 2006 12:01:04 -0000
- Subject: [Bug c++/26884] New: [4.1/4.2 regression] Misleading diagnostic for invalid array initializer
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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.
--
Summary: [4.1/4.2 regression] Misleading diagnostic for invalid
array initializer
Product: gcc
Version: 4.2.0
Status: UNCONFIRMED
Keywords: diagnostic, 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=26884