This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: c++/6273: [2003-01-30] User-defined operator+ and use of enum values in computation of array bounds


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]