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

2019-09-08 Thread Jonathan M Davis via Digitalmars-d-learn
On Sunday, September 8, 2019 12:12:53 PM MDT Exil via Digitalmars-d-learn wrote: > On Saturday, 7 September 2019 at 22:19:48 UTC, Jonathan M Davis > > wrote: > > On Saturday, September 7, 2019 3:40:58 PM MDT Exil via > > > > Digitalmars-d-learn wrote: > >> On Saturday, 7 September 2019 at

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

2019-09-08 Thread Exil via Digitalmars-d-learn
On Saturday, 7 September 2019 at 22:19:48 UTC, Jonathan M Davis wrote: On Saturday, September 7, 2019 3:40:58 PM MDT Exil via Digitalmars-d-learn wrote: On Saturday, 7 September 2019 at 17:22:07 UTC, Jonathan M Davis wrote: > @safe: > @system: > > then @system overrides @safe. Just to add

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

2019-09-08 Thread Max Samukha via Digitalmars-d-learn
On Sunday, 8 September 2019 at 09:35:03 UTC, Jonathan M Davis wrote: The C++ support has been improved kind of piecemeal over time, and initially, none of it was documented. So, it wasn't exactly fully planned out when it was added. IIRC, it was added originally so that the dmd frontend

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

2019-09-08 Thread Jonathan M Davis via Digitalmars-d-learn
On Sunday, September 8, 2019 3:03:31 AM MDT Max Samukha via Digitalmars-d- learn wrote: > On Saturday, 7 September 2019 at 22:19:48 UTC, Jonathan M Davis > > wrote: > > On Saturday, September 7, 2019 3:40:58 PM MDT Exil via > > > > Digitalmars-d-learn wrote: > >> On Saturday, 7 September 2019 at

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

2019-09-08 Thread Max Samukha via Digitalmars-d-learn
On Saturday, 7 September 2019 at 22:19:48 UTC, Jonathan M Davis wrote: On Saturday, September 7, 2019 3:40:58 PM MDT Exil via Digitalmars-d-learn wrote: On Saturday, 7 September 2019 at 17:22:07 UTC, Jonathan M Davis wrote: > @safe: > @system: > > then @system overrides @safe. Just to add

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

2019-09-07 Thread Jonathan M Davis via Digitalmars-d-learn
On Saturday, September 7, 2019 3:40:58 PM MDT Exil via Digitalmars-d-learn wrote: > On Saturday, 7 September 2019 at 17:22:07 UTC, Jonathan M Davis > > wrote: > > @safe: > > @system: > > > > then @system overrides @safe. > > Just to add onto this, you can't do: > > @safe @system void foo();

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

2019-09-07 Thread Exil via Digitalmars-d-learn
On Saturday, 7 September 2019 at 17:22:07 UTC, Jonathan M Davis wrote: @safe: @system: then @system overrides @safe. Just to add onto this, you can't do: @safe @system void foo(); // error but you can do: extern(C++, ns1) extern(C++, ns2) void foo(); // ok

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

2019-09-07 Thread Exil via Digitalmars-d-learn
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

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

2019-09-07 Thread Jonathan M Davis via Digitalmars-d-learn
On Saturday, September 7, 2019 9:15:44 AM MDT Max Samukha via Digitalmars-d- learn wrote: > extern(C++, "ns1"): > extern(C++, "ns2"): // Not in nested scope. Should it supersede? > void foo(); > > pragma(msg, foo.mangleof); // _ZN3ns13ns23fooEv instead of > expected _ZN3ns23fooEv > > Is that by

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

2019-09-07 Thread Max Samukha via Digitalmars-d-learn
extern(C++, "ns1"): extern(C++, "ns2"): // Not in nested scope. Should it supersede? void foo(); pragma(msg, foo.mangleof); // _ZN3ns13ns23fooEv instead of expected _ZN3ns23fooEv Is that by design?