This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/18470] New: [4.0 regression] array bound rejected as non-constant in template
- 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: 13 Nov 2004 21:01:23 -0000
- Subject: [Bug c++/18470] New: [4.0 regression] array bound rejected as non-constant in template
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
The following valid code snippet is rejected by mainline:
========================================
template<typename> struct A
{
static const int i=1;
};
template<typename T> struct B : A<T>
{
using A<T>::i;
char s[i]; // fails
char t[A<T>::i]; // compiles
};
========================================
bug.cc:9: error: array bound is not an integer constant
Mark, I suspect your patch for PR 18429 is responsible for the regression.
Could you please have a look?
--
Summary: [4.0 regression] array bound rejected as non-constant in
template
Product: gcc
Version: 4.0.0
Status: UNCONFIRMED
Keywords: rejects-valid, monitored
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,mmitchel at gcc dot gnu
dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18470