This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/29886] New: [4.0/4.1/4.2/4.3 regression] C-style cast misinterpreted as variable declaration
- 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: 18 Nov 2006 12:38:45 -0000
- Subject: [Bug c++/29886] New: [4.0/4.1/4.2/4.3 regression] C-style cast misinterpreted as variable declaration
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
The following IMHO valid code snippet is rejected since GCC 4.0.0:
============================
struct A
{
static int x[1];
};
void foo(int i)
{
if (int(A::x[i])) {}
}
============================
bug.cc: In function 'void foo(int)':
bug.cc:8: error: array bound is not an integer constant
--
Summary: [4.0/4.1/4.2/4.3 regression] C-style cast misinterpreted
as variable declaration
Product: gcc
Version: 4.3.0
Status: UNCONFIRMED
Keywords: rejects-valid, 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=29886