<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - clang-cl with -O1 doesn't generate a definition for a derived exported class's dtor"
   href="http://llvm.org/bugs/show_bug.cgi?id=21373">21373</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>clang-cl with -O1 doesn't generate a definition for a derived exported class's dtor
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>C++
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>ehsan@mozilla.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>dgregor@apple.com, llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>$ 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.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>