<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;">Status</td>
           <td>REOPENED
           </td>
           <td>RESOLVED
           </td>
         </tr>

         <tr>
           <td style="text-align:right;">Resolution</td>
           <td>---
           </td>
           <td>INVALID
           </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#c3">Comment # 3</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>(In reply to JVApen from <a href="show_bug.cgi?id=38354#c2">comment #2</a>)
<span class="quote">> I've tested this example with /Zc:inline as well as the whole codebase I'm
> working on for MSVC. This doesn't cause any linking error at all. This makes
> me assume that MSVC handles the implicit default methods differently. (I've
> also noticed something similar for classes containing unique_ptr as member,
> where Dtor also required extra include)

> This makes me assume that this bug ain't just about 'inline' and more about
> the default member functions. Would you mind taking a second look?</span >

MSVC's /Zc:inline isn't that smart. They haven't put much work into discarding
unneeded inline functions, and there is flexibility as to what functions get
discarded. It all boils down to the whims of the inliner, which are not
expected to be stable. In this case, MSVC ends up providing a definition for
A<int>::~A in t.obj, and we don't, and we're allowed not to. At least, we think
we're allowed not to.

<span class="quote">> FYI: My current fix for this code is actually to add: B::~B(){} in the Cpp
> (+ matching thing in header)</span >

That'll work OK, but there could be other implicit special members (operator=,
copy ctor) that might need to call methods of A. It's always dicey to declare
template methods in a header without providing definitions.</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>