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]

Internal Compiler Error + Question


The following program:
struct B
{
};

//struct B B;

template <int S = 1024> struct A
{
  struct B;
};

template <int S> struct A<S>::B : public ::B
{
};

int main()
{
  A<> a;
}

Generates:
bugsigaction.cpp:13: Internal compiler error.
bugsigaction.cpp:13: Please submit a full bug report.
bugsigaction.cpp:13: See <URL:http://www.gnu.org/software/gcc/bugs.html> for 
instructions. 

Under:
Reading specs from /usr/lib/gcc-lib/i386-linux/2.95.2/specs
gcc version 2.95.2 20000220 (Debian GNU/Linux)                                

Question:
If the variable 'struct B B' is defined, the compiler will think that 'struct 
A<>::B : public ::B' tries to inherit form a variable. Is this supposed to be 
that way in Standard C++? If so, is there a way to tell the compiler that we 
are trying to use the type B and not an instanciation? ('struct A<>::B : 
public struct ::B' does not work)

Please reply to:
philippeb@corel.com


Thank you.

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