Hi Bytes Community,
I've been away from C++ programming for some years, and now find me self in need to recompile old code that compiles under g++ 2.96, but not under g++ 3.4.3. I notice that g++ 3.4 changed the parser to be more conforming and thus I now see compile errors like tried illustrated below. I've been googlling around, but so far haven't understood the issue at hand, hoping for hints from someone here.
Got code like this:
line n+1: class classA; // forward declaration
line n+3: typedef templateClassC <classA> classD;
line n+5: class classB : public classD {
line n+6 virtual A *ptr2A() {};
line n+7 }
gives me compile time errors like:
line n+5: instantiated from here
line n+1: error: forward declaration of `struct classA'
Why it g++ 3.4.3 considering the forward declaration as been of a struct and not a class type (assuming my code in non-conforming, but how to resolve this chicken/egg issue)?
TIA
I've been away from C++ programming for some years, and now find me self in need to recompile old code that compiles under g++ 2.96, but not under g++ 3.4.3. I notice that g++ 3.4 changed the parser to be more conforming and thus I now see compile errors like tried illustrated below. I've been googlling around, but so far haven't understood the issue at hand, hoping for hints from someone here.
Got code like this:
line n+1: class classA; // forward declaration
line n+3: typedef templateClassC <classA> classD;
line n+5: class classB : public classD {
line n+6 virtual A *ptr2A() {};
line n+7 }
gives me compile time errors like:
line n+5: instantiated from here
line n+1: error: forward declaration of `struct classA'
Why it g++ 3.4.3 considering the forward declaration as been of a struct and not a class type (assuming my code in non-conforming, but how to resolve this chicken/egg issue)?
TIA
Comment