Re: Parsing C++

davidb@datalytics.com (David Bradley)
18 Dec 1996 00:11:06 -0500

          From comp.compilers

Related articles
[3 earlier articles]
Re: Parsing C++ jsgray@acm.org (Jan Gray) (1996-11-19)
Re: Parsing C++ jlilley@empathy.com (1996-12-03)
Re: Parsing C++ dlmoore@ix.netcom.com (David L Moore) (1996-12-07)
Re: Parsing C++ jlilley@empathy.com (1996-12-09)
Re: Parsing C++ jlilley@empathy.com (1996-12-09)
Re: Parsing C++ fjh@mundook.cs.mu.OZ.AU (1996-12-10)
Re: Parsing C++ davidb@datalytics.com (1996-12-18)
| List of all articles for this month |
From: davidb@datalytics.com (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$7t7@netlab.cs.rpi.edu>
Keywords: C++

fjh@mundook.cs.mu.OZ.AU (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)
    {
            print(x);
            double x = 2.0;
            print(x);
    }
}


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


--------------------------------------------
David Bradley davidb@datalytics.com
Software Engineer
Datalytics, Inc. http://www.datalytics.com
--


Post a followup to this message

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