c++/8633: [3.3 regression] typedefs as base classes
bangerth@dealii.org
bangerth@dealii.org
Mon Nov 25 15:36:00 GMT 2002
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
More information about the Gcc-prs
mailing list