Mingling string and identifier namespaces in nested extern(C++) decls

Max Samukha maxsamukha at gmail.com
Sat Sep 7 14:53:54 UTC 2019


extern(C++, "ns1") {
	extern(C++, ns2) {
		extern(C++, "ns3") {
			extern(C++, ns4) {
				void foo();
			}
		}
	}
}

pragma(msg, foo.mangleof); // _ZN3ns23ns43ns13ns33fooEv

That produces 'ns2::ns4::ns1::ns3::foo' path instead of the 
intuitively expected 'ns1::ns2::ns3::ns4::foo'. The identifier 
namespaces are grouped before the string ones. Bug or feature?


More information about the Digitalmars-d-learn mailing list