Topic: Qualifiers in Declarations
Author: mat@mole-end
Date: Sun, 7 Jun 1992 00:22:22 GMT Raw View
Below are a set of declaractions, almost all of which are rejected
by C++ (cfront 3.0). They all seem plausible and useful to me, and
they all _seem_ to me to be syntacticly valid and semantically
meaningful (and unambiguous).
Can anyone straighten me out on which _should_ be legal according
to the best current authority? In other words, what is the
algorithm for introducing class names, and how does it interact with
qualification?
class X; // Ok
class X::Xa;
class Y; // Ok
class Y::Ya;
class T1 { friend class X; public: void a_fun(); };
// On the next one, if I introduce a definition for X and within it
// for X::Xa, I get an internal compiler error:
class T2 { friend class X::Xa; public: void a_fun(); };
class T3 { friend class X::Xb; public: void a_fun(); };
class T4 { friend class Z; public: void a_fun(); };
class T5 { friend class Z::Za; public: void a_fun(); };
class T6 { friend void X::f1(); public: void a_fun(); };
class T7 { friend void X::Xa::f1(); public: void a_fun(); };
class T8 { friend void Z::Xa::f1(); public: void a_fun(); };
--
(This man's opinions are his own.)
From mole-end Mark Terribile
uunet!mole-end!mat, Somewhere in Matawan, NJ