[Issue 13337] New: Invalid extern C++ namespace resolution
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Tue Aug 19 23:24:05 PDT 2014
https://issues.dlang.org/show_bug.cgi?id=13337
Issue ID: 13337
Summary: Invalid extern C++ namespace resolution
Product: D
Version: D2
Hardware: x86_64
OS: Linux
Status: NEW
Severity: normal
Priority: P1
Component: DMD
Assignee: nobody at puremagic.com
Reporter: chatelet.guillaume at gmail.com
Consider this C++ code :
namespace A {
namespace B {
struct Type {};
int foo(Type unused){ return 42; }
} // namespace B
} // namespace A
Now this D code uses foo :
extern(C++, A.B) {
struct Type {}
int foo(Type unused);
}
void main() {
foo(Type());
}
Compilation gives :
cpp_namespace.d:(.text._Dmain+0x11): undefined reference to
`A::B::foo(A::Type)'
Type is resolved in A and not in A.B
Specifying the full name doesn't help and gives the same result
extern(C++, A.B) {
struct Type {}
int foo(A.B.Type unused);
}
void main() {
A.B.foo(A.B.Type());
}
--
More information about the Digitalmars-d-bugs
mailing list