<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 --- - Cannot link to DLLs if an RTTI class in the binary derives from an RTTI class defined in a DLL"
   href="http://llvm.org/bugs/show_bug.cgi?id=20106">20106</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Cannot link to DLLs if an RTTI class in the binary derives from an RTTI class defined in a DLL
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

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

        <tr>
          <th>OS</th>
          <td>Windows NT
          </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>Frontend
          </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>llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>This bug hits us when building ICU as a DLL on Windows:

$ cat type.h
#ifdef DLL
#define API __declspec(dllexport)
#else
#define API __declspec(dllimport)
#endif

struct API VFoo {
virtual ~VFoo();
};

$ cat type.cpp
#include "type.h"

VFoo::~VFoo() {};

$ cat test.cpp
#include "type.h"

class XYZ : public VFoo {};

int main() {
  new XYZ();
}

$ clang-cl -GR type.cpp -DDLL -link -dll -out:type.dll
   Creating library type.lib and object type.exp

$ clang-cl -GR test.cpp type.lib -D_HAS_EXCEPTIONS=0
test-97d7d3.obj : error LNK2001: unresolved external symbol "struct VFoo `RTTI
Type Descriptor'" (??_R0?AUVFoo@@@8)
test-97d7d3.obj : error LNK2001: unresolved external symbol "VFoo::`RTTI Class
Hierarchy Descriptor'" (??_R3VFoo@@8)
test.exe : fatal error LNK1120: 2 unresolved externals
clang-cl.exe: error: linker command failed with exit code 1120 (use -v to see
invocation)</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>