This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: c++/8633: [3.3 regression] typedefs as base classes
- 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, struppi at acm dot org
- Date: 19 Nov 2002 15:13:11 -0000
- Subject: Re: c++/8633: [3.3 regression] typedefs as base classes
- 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, struppi at acm dot org, gcc-gnats at gcc dot gnu dot org
Old Synopsis: g++ doesn't resolve typedefs of templated classes properly
New Synopsis: [3.3 regression] typedefs as base classes
State-Changed-From-To: open->analyzed
State-Changed-By: bangerth
State-Changed-When: Tue Nov 19 07:13:10 2002
State-Changed-Why:
Confirmed. This is a reduced testcase:
-----------------------
namespace NS {
class X {};
typedef X Y;
}
struct Base : virtual public NS::Y {
Base() : NS::Y() {}
};
-------------------------
The messages are
tmp/g> /home/bangerth/bin/gcc-3.3x-pre/bin/c++ x.cc
x.cc: In constructor `Base::Base()':
x.cc:7: error: type `NS::Y' is not a direct or virtual base of `Base'
I am unsure whether the code is illegal: 10.1 states that
the names of base classes shall be class names, so a
typedef may not qualify. However, gcc should then tell us
so at the point of the base class list, not in the
constructor. What is also suspicious is that the error
goes away if one makes the base class non-virtual or moves
X and Y into the global namespace. Something's wrong here.
I can compile the testcase above with 2.95 and 3.2.1pre, so
assuming it is legal, it is a regression. I thus raise its
priority. If it is not legal, someone will give an explanation
of this inconsistent behavior.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=8633