🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by Graham D. Parrington Wed, 12 Sep 1990 14:11
Interpretation of nested scope rules for class declarations
#504
Author: Graham D. Parrington
Date: Wed, 12 Sep 1990 14:11
33 lines
1618 bytes
According to E&S section 10.4 (p 216) :
	"the declaration of a member name hides declarations
	 of the same name in base classes and global names"

Therefore the following should (I think) be (strictly) illegal:

	class X
	{
	    X();
	    ~X();

	    X* do_something();
	}

since the declaration of the constructor introduces a member named X
into scope hiding X as a typename (or classname) thus making the return
type of 'do_something' undefined unless elaborated as 'class X'.
Is this interpretation correct? (cfront 2.1 doesn't implement it).
Maybe something needs to be said along the lines of "the current class
name is always a typename when delaring a class"?
Comments anyone?

Graham
--
Graham Parrington, Computing Laboratory, University of Newcastle upon Tyne
ARPA  = Graham.Parrington%newcastle.ac.uk@nsfnet-relay.ac.uk
UUCP  = ...!ukc!newcastle.ac.uk!Graham.Parrington
PHONE = +44 91 222 8067

Graham Parrington, Computing Laboratory, University of Newcastle upon Tyne
ARPA  = Graham.Parrington%newcastle.ac.uk@nsfnet-relay.ac.uk
UUCP  = ...!ukc!newcastle.ac.uk!Graham.Parrington
PHONE = +44 91 222 8067
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads