This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: c++/6273: [2003-01-30] User-defined operator+ and use of enum values in computation of array bounds
- From: bangerth at dealii dot org
- To: comer at mailru dot com, gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, nobody at gcc dot gnu dot org
- Date: 1 Feb 2003 21:28:04 -0000
- Subject: Re: c++/6273: [2003-01-30] User-defined operator+ and use of enum values in computation of array bounds
- Reply-to: bangerth at dealii dot org, comer at mailru dot com, gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, nobody at gcc dot gnu dot org, gcc-gnats at gcc dot gnu dot org
Old Synopsis: [2003-01-20] ICE in tree_low_cst, at tree.c:3471, also an error with gcc 2.95.3
New Synopsis: [2003-01-30] User-defined operator+ and use of enum values in computation of array bounds
State-Changed-From-To: open->analyzed
State-Changed-By: bangerth
State-Changed-When: Sat Feb 1 21:28:04 2003
State-Changed-Why:
With recent snapshots, it's not an ICE any more. However,
when reducing the code to the following
-----------------------
template <typename> struct X {
enum { N = 10 };
int items[N+1];
};
template <typename A, typename B> int operator+(A,B);
X<int> x;
------------------------
we still get an error:
test/x> ../../bin/gcc-2003-01-30/bin/c++ -c x.cc
x.cc:6: error: variable-size type declared outside of any function
x.cc:6: error: variable-size type declared outside of any function
Apparently, the user-defined template op+ is used to
determine the array size. I don't know whether this is
right or wrong...
W.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=6273