<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </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 - Constructor for template class codegen'd multiple times with dllexport explicit instantiation"
   href="https://bugs.llvm.org/show_bug.cgi?id=47683">47683</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Constructor for template class codegen'd multiple times with dllexport explicit instantiation
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>new-bugs
          </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>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>new bugs
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>aeubanks@google.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>hans@chromium.org, htmldeveloper@gmail.com, llvm-bugs@lists.llvm.org, rnk@google.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>$ cat /tmp/repro.cc
class a {
public:
  a();
};
class b;
template <class> class c {
  c() = default;
  a d;
};
extern template class c<b>;
template class __declspec(dllexport) c<b>;

$ clang -cc1 -triple x86_64-pc-windows-msvc19.16.0 -fms-compatibility
-emit-llvm /tmp/repro.cc
clang: ../../clang/lib/CodeGen/CodeGenFunction.cpp:694: void
clang::CodeGen::CodeGenFunction::StartFunction(clang::GlobalDecl,
clang::QualType, llvm::Function *, const clang::CodeGen::CGFunctionInfo &,
const clang::CodeGen::FunctionArgList &, clang::SourceLocation,
clang::SourceLocation): Assertion `CurFn->isDeclaration() && "Function already
has body?"' failed.


<a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED FIXED - "Function already has body?" assert on explicitly defaulted non-trivial dllexport ctor during explicit template instantiation"
   href="show_bug.cgi?id=42857">https://bugs.llvm.org/show_bug.cgi?id=42857</a> seems related.</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>