Topic: Is qualified name allowed in member declaration?


Author: sgganesh@gmail.com (Ganesh)
Date: Thu, 29 Jul 2004 12:29:49 GMT
Raw View
In the following code:

struct A {
   void A::func() {}
};

Isn't it valid to declare the member as a qualified name, as A::func,
within scope of A? However I get "error: qualified name is not allowed
in member declaration" when using Comeau (online version 4.3.3)
compiler? Isn't that 3.4.3.1 allow a class member to be referred to
using a qualified-id at any point in its scope?

-Ganesh

---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html                       ]





Author: AlbertoBarbati@libero.it (Alberto Barbati)
Date: Thu, 29 Jul 2004 15:58:48 GMT
Raw View
Ganesh wrote:
> In the following code:
>
> struct A {
>    void A::func() {}
> };
>
> Isn't it valid to declare the member as a qualified name, as A::func,
> within scope of A? However I get "error: qualified name is not allowed
> in member declaration" when using Comeau (online version 4.3.3)
> compiler? Isn't that 3.4.3.1 allow a class member to be referred to
> using a qualified-id at any point in its scope?
>

If I read 3.3.6 correctly, the potential scope of a class member name
does not include that name's declarator (in 3.3.6/1 it is explicitly
said "the declarative region following the name's declarator"), so
3.4.3.1 does not apply in this case.

Alberto

---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html                       ]