This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/19989] New: Inconsistency with zero-sized arrays
- 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: 15 Feb 2005 22:56:02 -0000
- Subject: [Bug c++/19989] New: Inconsistency with zero-sized arrays
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
The following testcase shows some inconsistency w.r.t zero-size arrays.
Without "-pedantic" we diagnose the array(s) whose dimension is found via
dependent lookup.
==============================================
template<int> struct A
{
static const int i = 0;
};
template<int N> struct B
{
int x[A<N>::i]; // error
int y[A<0>::i]; // no error since 3.4.0
int z[0]; // no error
};
B<0> b;
==============================================
Depending on the point of view this is rejects-valid or accepts-invalid.
Btw, with "-pedantic" we diagnose all three arrays.
--
Summary: Inconsistency with zero-sized arrays
Product: gcc
Version: 4.0.0
Status: UNCONFIRMED
Keywords: diagnostic
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: reichelt at gcc dot gnu dot org
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19989