This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [C++] Overloading a type name with a function
- To: drow@false.org
- Subject: Re: [C++] Overloading a type name with a function
- From: "Martin v. Loewis" <martin@mira.isdn.cs.tu-berlin.de>
- Date: Sat, 7 Aug 1999 22:00:52 +0200
- CC: gcc@gcc.gnu.org
- References: <19990807110722.A10855@them.org>
> From what I can tell the definition of 'class A' is completely hidden
> in C by 'bool B::A(int)'. Thus a syntax error in the declaration of
> myA. Is this right, or should the compiler find the class A
> declaration in the top level?
This is right; the method shadows the class. To correct this, you can
either write
class C : public B { class A myA; };
or
class C : public B { ::A myA; };
Regards,
Martin