<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><span class="vcard"><a class="email" href="mailto:rnk@google.com" title="Reid Kleckner <rnk@google.com>"> <span class="fn">Reid Kleckner</span></a>
</span> changed
          <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED INVALID - Clang-cl generates more code, in this case the Dtor. Resulting in link errors"
   href="https://bugs.llvm.org/show_bug.cgi?id=38354">bug 38354</a>
          <br>
             <table border="1" cellspacing="0" cellpadding="8">
          <tr>
            <th>What</th>
            <th>Removed</th>
            <th>Added</th>
          </tr>

         <tr>
           <td style="text-align:right;">Resolution</td>
           <td>---
           </td>
           <td>INVALID
           </td>
         </tr>

         <tr>
           <td style="text-align:right;">Status</td>
           <td>NEW
           </td>
           <td>RESOLVED
           </td>
         </tr></table>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED INVALID - Clang-cl generates more code, in this case the Dtor. Resulting in link errors"
   href="https://bugs.llvm.org/show_bug.cgi?id=38354#c1">Comment # 1</a>
              on <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED INVALID - Clang-cl generates more code, in this case the Dtor. Resulting in link errors"
   href="https://bugs.llvm.org/show_bug.cgi?id=38354">bug 38354</a>
              from <span class="vcard"><a class="email" href="mailto:rnk@google.com" title="Reid Kleckner <rnk@google.com>"> <span class="fn">Reid Kleckner</span></a>
</span></b>
        <pre>This links successfully without optimizations, but fails with optimizations.

With optimizations, LLVM discards the definition of A<int>::~A in t.obj after
inlining. This is normal for inline functions. Every TU that needs the
definition of an inline function must provide one. This rule exists to allow
each TU to individually discard inline function definitions that are not
needed.

MSVC implements this optimization under /Zc:inline
(<a href="https://msdn.microsoft.com/en-us/library/dn642448.aspx">https://msdn.microsoft.com/en-us/library/dn642448.aspx</a>), but it is not on by
default for compatibility with code like this.

To fix the code, move the template method definitions into the .h file.</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>