[LLVMbugs] [Bug 21373] New: clang-cl with -O1 doesn't generate a definition for a derived exported class's dtor

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Oct 24 11:29:57 PDT 2014


http://llvm.org/bugs/show_bug.cgi?id=21373

            Bug ID: 21373
           Summary: clang-cl with -O1 doesn't generate a definition for a
                    derived exported class's dtor
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: ehsan at mozilla.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

$ cat test.cpp
class Base {
public:
  virtual ~Base();
};

Base::~Base() {}

class __declspec(dllexport) Derived : public Base {
};

$ clang-cl -O1 -c test.cpp && llvm-nm test.obj | grep Derived
00000000 T ??0Derived@@QAE@$$QAV0@@Z
00000000 T ??0Derived@@QAE at ABV0@@Z
00000000 T ??0Derived@@QAE at XZ
         w ??1Derived@@UAE at XZ
00000000 T ??4Derived@@QAEAAV0@$$QAV0@@Z
00000000 T ??4Derived@@QAEAAV0 at ABV0@@Z
00000004 R ??_7Derived@@6B@
00000000 T ??_GDerived@@UAEPAXI at Z
00000000 D ??_R0?AVDerived@@@8
00000000 R ??_R1A@?0A at EA@Derived@@8
00000000 R ??_R2Derived@@8
00000000 R ??_R3Derived@@8
00000000 R ??_R4Derived@@6B@

Note how the ??1Derived@@UAE at XZ symbol is undefined.  Removing either -O1 or
the dllexport on Derived makes the bug go away.

This hits Skia's SkNullGLContext class.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20141024/dcbedb24/attachment.html>


More information about the llvm-bugs mailing list