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: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected]
    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@ABV0@@Z
00000000 T ??0Derived@@QAE@XZ
         w ??1Derived@@UAE@XZ
00000000 T ??4Derived@@QAEAAV0@$$QAV0@@Z
00000000 T ??4Derived@@QAEAAV0@ABV0@@Z
00000004 R ??_7Derived@@6B@
00000000 T ??_GDerived@@UAEPAXI@Z
00000000 D ??_R0?AVDerived@@@8
00000000 R ??_R1A@?0A@EA@Derived@@8
00000000 R ??_R2Derived@@8
00000000 R ??_R3Derived@@8
00000000 R ??_R4Derived@@6B@

Note how the ??1Derived@@UAE@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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to