extern(C++, ns)

Timon Gehr via Digitalmars-d digitalmars-d at puremagic.com
Mon Jan 11 12:56:04 PST 2016


On 01/11/2016 09:53 PM, Walter Bright wrote:
> On 1/11/2016 12:23 PM, Timon Gehr wrote:
>> If replacing extern(C++,ns) with extern(C++) fixes undefined
>> identifier errors, then we are talking about a bug in the implementation.
>
> No:
>
> -----
> module s;
> int ns,b;
> -----
> module t;
> int ns,c;
> -----
> import s;
> import t;
> void foo() {
>     int x = ns;  // Error: 's.ns' or 't.ns'?

This not an undefined identifier error.

>     b = c;       // no problem
> }
> -----
>
> Why do the same name lookup rules become a bug if "int ns" is replaced
> with "extern(C++,ns)" ?

They don't.


More information about the Digitalmars-d mailing list