[LLVMbugs] [Bug 14447] New: [Windows] Aliasing destructors are not handled correctly in COFF?

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Nov 28 06:56:09 PST 2012


             Bug #: 14447
           Summary: [Windows] Aliasing destructors are not handled
                    correctly in COFF?
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: timurrrr at google.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

=== test.cpp ===
struct A { ~A() {} };
template<class T> struct B : A { };
template<class T> struct C : B<T> { };
template<class T> struct D : C<T> { };

namespace {
  struct s {};

int main() {
  D<s> d;

As of r168782 with the following patch (xref bug 13443):
diff --git lib/CodeGen/CGClass.cpp lib/CodeGen/CGClass.cpp
index b2225e4..fbe433b 100644
--- lib/CodeGen/CGClass.cpp
+++ lib/CodeGen/CGClass.cpp
@@ -1218,7 +1218,7 @@ void CodeGenFunction::destroyCXXObject(CodeGenFunction
   const CXXRecordDecl *record = cast<CXXRecordDecl>(rtype->getDecl());
   const CXXDestructorDecl *dtor = record->getDestructor();
-  CGF.EmitCXXDestructorCall(dtor, Dtor_Complete, /*for vbase*/ false,
+  CGF.EmitCXXDestructorCall(dtor, Dtor_Base/*Dtor_Complete*/, /*for vbase*/
I get the following:
$ clang -Xclang -cxx-abi -Xclang microsoft test.cpp
test-492687.o : error LNK2019: unresolved external symbol "public: __thiscall
D<struct `anonymous namespace'::s>::~D<struct `anonymous namespace'::s>(void)"
(??1?$D at Us@?A@@@@QAE at XZ) referenced in function _main

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.

More information about the llvm-bugs mailing list