http://llvm.org/bugs/show_bug.cgi?id=9197
Summary: derived virtual destructor not called
Product: clang
Version: trunk
Platform: PC
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P
Component: LLVM Codegen
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected]
This C++ test program should print "destructed!":
extern "C" int puts(const char *);
struct Test { ~Test() { puts("destructed!"); } };
struct Base {
virtual ~Base();
};
Base::~Base() { }
namespace {
struct Deriv : public Base {
Test t[1];
};
}
int main(void) {
Base *b = new Deriv();
delete b;
};
but doesn't when compiled by clang. The Base::~Base() destructor is called, but
not Deriv, which means that Test is never torn down. Either removing Deriv from
the anonymous namespace or making 't' not be an array masks the bug.
--
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