Re: Parsing C++ (David Bradley)
18 Dec 1996 00:11:06 -0500

          From comp.compilers

Related articles
[3 earlier articles]
Re: Parsing C++ (Jan Gray) (1996-11-19)
Re: Parsing C++ (1996-12-03)
Re: Parsing C++ (David L Moore) (1996-12-07)
Re: Parsing C++ (1996-12-09)
Re: Parsing C++ (1996-12-09)
Re: Parsing C++ (1996-12-10)
Re: Parsing C++ (1996-12-18)
| List of all articles for this month |

From: (David Bradley)
Newsgroups: comp.compilers
Date: 18 Dec 1996 00:11:06 -0500
Organization: Datalytics Inc.
References: 96-11-102 96-12-029 96-12-052 <58gno3$>
Keywords: C++ (Fergus Henderson) wrote:

>> int foo;
>> class A {
>> void bar() { foo x; }
>> enum foo {bar,bletch};
>> };
>>I believe this should compile with x being an enum.

>>(On the other hand
>>there is a "Symbols cannot change meaning" rule which may apply here -

>Yes, if I interpret it correctly, that rule (3.3.6 [basic.class.scope] in
>the latest C++ draft working paper) specifies that this example is ill-formed.
>(Unfortunately the rule is stated in language that is quite unclear,
>so I can't be completely sure that my interpretation is correct.)

This is much like the situation I ran into below:

void foo(void)
    int x = 1;
    if (true)
            double x = 2.0;

This is perfectly legal, and I imagine it would be hard to allow both

David Bradley
Software Engineer
Datalytics, Inc.

Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.