c++/9937: Failure to lookup base class name when base is template specialization
bangerth@dealii.org
bangerth@dealii.org
Tue Mar 4 15:45:00 GMT 2003
Synopsis: Failure to lookup base class name when base is template specialization
State-Changed-From-To: open->analyzed
State-Changed-By: bangerth
State-Changed-When: Tue Mar 4 15:45:30 2003
State-Changed-Why:
This applies to all versions of gcc since at least 2.95:
Something seems indeed inconsistent. Your access in struct Z
is bogus, but this is an extract:
------------------------
namespace NS {
struct A {};
template <class T>
struct B {};
}
struct X : NS::A { A* a; };
struct Y : NS::B<int> { B<int>* b; };
--------------------
While struct X seems to be ok, struct Y seems not:
g/x> /home/bangerth/bin/gcc-3.4-pre/bin/gcc -c x.cc
x.cc:9: error: ISO C++ forbids declaration of `B' with no type
x.cc:9: error: expected function-definition
I must admit that I don't know whether gcc is right or
wrong here -- the treatment of NS::A and NS::B seems
inconsistent --, but icc at least shares gcc's opinion:
g/x> icc -c x.cc
x.cc(9): error: B is not a template
struct Y : NS::B<int> { B<int>* b; };
^
I leave this to more experienced language lawyers.
W.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=9937
More information about the Gcc-prs
mailing list