extern(C++, ns)

Walter Bright via Digitalmars-d digitalmars-d at puremagic.com
Mon Jan 11 12:53:27 PST 2016


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'?
    b = c;       // no problem
}
-----

Why do the same name lookup rules become a bug if "int ns" is replaced with 
"extern(C++,ns)" ?


More information about the Digitalmars-d mailing list