http://llvm.org/bugs/show_bug.cgi?id=15058
Bug #: 15058
Summary: [-cxx-abi microsoft] Implement proper handling of
virtual destructors
Product: clang
Version: trunk
Platform: PC
OS/Version: Windows NT
Status: NEW
Severity: enhancement
Priority: P
Component: C++
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected], [email protected]
Classification: Unclassified
Here's a repro which shows some things that currently go wrong.
--------------------------------------
$ cat with_cl.cpp
struct Base {
virtual ~Base();
};
extern "C" int printf(const char *fmt, ...);
Base::~Base() {
printf("OK: %s\n", __FUNCTION__);
}
void call_complete_dtor(Base* obj) {
obj->~Base();
printf("After obj->~Base();\n");
}
--------------------------------------
$ cat with_clang.cpp
struct Base {
virtual ~Base();
};
extern "C" int printf(const char *fmt, ...);
struct Derived: Base {
virtual ~Derived() {
printf("OK: %s\n", __FUNCTION__);
}
};
void call_complete_dtor(Base* obj);
int main() {
call_complete_dtor(new Derived);
printf("After call_complete_dtor\n");
}
--------------------------------------
$ cl -nologo -c with_cl.cpp with_clang.cpp && link -nologo with_cl.obj
with_clang.obj && ./with_cl.exe
OK: Derived::~Derived
OK: Base::~Base
After obj->~Base();
After call_complete_dtor
$ cl -nologo -c with_cl.cpp && \
clang++ -Xclang -cxx-abi -Xclang microsoft -fno-rtti -c with_clang.cpp && \
link -nologo with_cl.obj with_clang.o && ./with_cl.exe
OK: ~Derived
OK: Base::~Base
After obj->~Base();
Segmentation fault
--
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs