<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 --- - Don't dllexport vftable in anonymous classes"
   href="http://llvm.org/bugs/show_bug.cgi?id=21399">21399</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Don't dllexport vftable in anonymous classes
          </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>Linux
          </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>LLVM Codegen
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>hans@chromium.org
          </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>Consider:

  namespace {
    struct __declspec(dllexport) S {
      virtual void foo();
    };
  };

  void __declspec(dllexport) f() {
    S s;
  }

bin\clang-cl /LD d:\src\tmp\a.cc
   Creating library a.lib and object a.exp
a-755166.obj : error LNK2001: unresolved external symbol "public: virtual void
_
_thiscall `anonymous namespace'::S::foo(void)" (?foo@S@?A@@UAEXXZ)
a.exp : error LNK2001: unresolved external symbol "const `anonymous
namespace'::
S::`vftable'" (??_7S@?A@@6B@)
a.dll : fatal error LNK1120: 2 unresolved externals
clang-cl.exe: error: linker command failed with exit code 1120 (use -v to see
in
vocation)


We should not try to export the vftable here. We should also warn the user that
exporting things in the anonymous namespace doesn't make sense (and for
dllimport maybe we should error?)</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>