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]

Re: Error 19970302


Martin,

Thank you very much for your prompt response.

My C++ might be a bit deficient, but I'm pretty sure that should in fact be
allowed under ANSI C++.  (Please correct me if I'm wrong.)  In fact, removing
the base class entirely prevents any compilation errors for me.  I have
reattached the file test.ii which causes the error.  In addition, I have
attached the file test2.ii, which compiles perfectly fine.  You can see that
the difference is very minor.

To reiterate my problem, I've been receiving the following error:

test.cpp:8: Internal compiler error 19970302.
test.cpp:8: Please submit a full bug report.
test.cpp:8: See <URL:http://www.gnu.org/software/gcc/faq.html#bugreport>
for instructions

My system is
- gcc version 2.95.2
- GNU/Linux, kernel 2.2.14 (Mandrake 7.1) on i686 (Intel P2)
and I've been using the command "gcc -c test.cpp" (or "gcc -c test2.cpp").

Thank you once again,

Wayne M. Miller
waynem@tiac.net


"Martin v. Loewis" wrote:

> Thanks for your bug report. The mainline compiler (2.96 20000624
> (experimental)) says
>
> test.cpp:7: size of member `array' is not constant
>
> so the bug has been fixed. The error message may be somewhat
> confusing: the constant value of ArraySize is not known at the point
> where it is used - that is the error.
>
> Regards,
> Martin
class Base {
};

class Derived : public Base {
public:
    static const int ArraySize;
    int array[ArraySize];
};

const int Derived::ArraySize = 10;    // can be anything
class Derived {
public:
    static const int ArraySize;
    int array[ArraySize];
};

const int Derived::ArraySize = 10;    // can be anything

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