This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

[C++] Overloading a type name with a function


I have this testcase, which compiled under egcs 1.1.2:

---------

class A {};

class B { protected: bool A(int a); };

class C : public B { A myA; };

---------

>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?


Dan

/--------------------------------\  /--------------------------------\
|       Daniel Jacobowitz        |__|        SCS Class of 2002       |
|   Debian GNU/Linux Developer    __    Carnegie Mellon University   |
|         dan@debian.org         |  |       dmj+@andrew.cmu.edu      |
\--------------------------------/  \--------------------------------/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]