🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c++
Article #49

name of class as name of nonconstructor member

#49
From: Daniel R. Edelson
Date: Tue, 21 Jul 1992 12:12
27 lines
1219 bytes
I think the following code is illegal, but am not
certain the draft Standard contains a prohibition.

   struct S {
	int S;
   };

Without explicitly discussing this case (as far as I have
discovered), I think the draft Standard forbids this for the
following reason.

	Whether or not the user declares one, S has a
	constructor. There may not be an outline function
	emitted, but S::S() can be called. Therefore, the
	declaration of "int S" redeclares as a datum an
	identifier that is already declared in the same 
	scope to be a function.

I don't consider this argument completely waterproof. 
If someone can phrase it more convincingly, I'd appreciate 
hearing the argument.

Thanks a bunch,
Daniel 
daniel.edelson@inria.fr

	
Technical Details
Message-ID: <4011@seti.UUCP>
Path: arc1-ca.pugleaf.net!sparky!uunet!mcsun!corton!seti!goudurix.inria.fr!edelson

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!mcsun!corton!seti!goudurix.inria.fr!edelson
From: daniel.edelson@inria.fr (Daniel R. Edelson)
Newsgroups: comp.std.c++
Subject: name of class as name of nonconstructor member
Message-ID: <4011@seti.UUCP>
Date: 21 Jul 92 12:12:23 GMT
Sender: news@seti.UUCP
Reply-To: Daniel R. Edelson <daniel.edelson@inria.fr>
Organization: INRIA -- Institut National de Recherche en Informatique et Automatique -- Rocquencourt, France
Lines: 27