[cfe-dev] Hello

Sebastian Redl sebastian.redl at getdesigned.at
Sun Oct 5 12:50:38 PDT 2008


Argiris Kirtzidis wrote:
> Hi Sebastian,
>
> Sebastian Redl wrote:
>
>> Consider also:
>>> I think this is correct since the spec says nothing about "'::' 
>>> associativity".
>>>   
>> :: is part of productions further down the tree than anything else, 
>> so it binds more strongly than anything else. However, it only binds 
>> to left-hand identifiers that actually name a namespace or class. 
>> Otherwise, it's the global scope.
>
> Hmm, the standard says at  3.4.3p1: "During the lookup for a name 
> preceding the '::' scope resolution operator, object, function, and 
> enumerator names are ignored. If the name found is not a class-name or 
> namespace-name, the program is ill-formed".
> It seems to me that '::' binds to left-hand identifiers and if the 
> identifier is not a namespace or class, we can consider it an error. I 
> can't find anything about resorting to the global scope when the 
> identifier exists and it's not a class or namespace.
> For comparison, both MSVC and Comeau report something like "error: 
> name followed by '::' must be a class or namespace".
The contradiction between 3.4.3 and 5.1 was part of the defect report.

Sebastian



More information about the cfe-dev mailing list