Should an 'extern(C++, "ns"):' override previous ones in the same scope?

Exil Exil at gmall.com
Sat Sep 7 20:57:35 UTC 2019


On Saturday, 7 September 2019 at 17:22:07 UTC, Jonathan M Davis 
wrote:
> makes no sense whatsoever IMHO. IIRC, this version of 
> extern(C++) didn't go through the DIP process and was simply 
> added via a PR.


The original extern(C++) worked the same way. Since it was 
implemented in v2.066.0 by the looks of it. IIRC the only thing 
the PR did was basically remove the code that added new objects. 
So it's to be expected they behave the same way.

https://run.dlang.io/is/v1vFeZ

     extern(C++, ns1):
     extern(C++, ns2):
     void foo();

     pragma(msg, foo.mangleof);

     void main() { }

Since      2.066.0: Success with output: _ZN3ns13ns23fooEv


More information about the Digitalmars-d-learn mailing list