<html>
    <head>
      <base href="https://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 --- - [ms] clang-cl emits scalar deleting ctor and vtable for templates with dllimported instantiation declaration"
   href="https://llvm.org/bugs/show_bug.cgi?id=27811">27811</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[ms] clang-cl emits scalar deleting ctor and vtable for templates with dllimported instantiation declaration
          </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>C++
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>nicolasweber@gmx.de
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>dgregor@apple.com, llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Somewhat similar to <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - [ms] clang-cl emits definitions for methods of inner classes of template classes of the template has a dllimported instantiation declaration"
   href="show_bug.cgi?id=27810">bug 27810</a>, but I'm less sure that it's wrong -- I vaguely
remember that we emit some members more often than cl on purpose.
Anyhow...consider:

template <class T>
struct codecvt {
  virtual ~codecvt() {
  }
};
template class __declspec(dllimport) codecvt<char>;

clang-cl emits a whole lot of stuff for this. cl emits nothing. Regular
non-windows clang also emits nothing if this is converted to an `extern
template class codecvt<char>`.


This too causes us to emit many functions (order of 60) into every TU including
MS C++ headers. Other than <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - [ms] clang-cl emits definitions for methods of inner classes of template classes of the template has a dllimported instantiation declaration"
   href="show_bug.cgi?id=27810">bug 27810</a>, these functions disappear after -O2, but
it'd probably be much faster to not emit them in the first place, instead of
relying on the optimizer to clean them up.</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>