This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: c++/9937: Failure to lookup base class name when base is template specialization
- From: bangerth at dealii dot org
- To: gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, nobody at gcc dot gnu dot org, witt at ive dot uni-hannover dot de
- Date: 4 Mar 2003 15:45:31 -0000
- Subject: Re: c++/9937: Failure to lookup base class name when base is template specialization
- Reply-to: bangerth at dealii dot org, gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, nobody at gcc dot gnu dot org, witt at ive dot uni-hannover dot de, gcc-gnats at gcc dot gnu dot org
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