This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/6273] [4.0/4.1 regression] User-defined operator+ and use of enum values in computation of array bounds
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 23 Jun 2005 03:47:10 -0000
- Subject: [Bug c++/6273] [4.0/4.1 regression] User-defined operator+ and use of enum values in computation of array bounds
- References: <20020412062603.6273.comer@mail333.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-06-23 03:47 -------
(In reply to comment #7)
> ---------------------------------------------------------------------
> template <typename> struct X {
> enum { N = 10 };
> int items[N+1];
> };
> template <typename A, typename B> int operator+(A,B);
> X<int> x;
> ----------------------------------------------------------------------
Actually I think there is two different bugs here, the above code is vaild I think because operators just
like functions have an overloaded set for lookup which is PR 2922.
The testcase which is questionable is:
template <typename A, typename B> int operator+(A,B);
template <typename> struct X {
enum a{ N = 10 };
int items[N+1];
};
X<int> x;
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=6273