home *** CD-ROM | disk | FTP | other *** search
- Path: 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
-
- 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
-
-
-