<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 - "Function already has body?" assert on explicitly defaulted non-trivial dllexport ctor during explicit template instantiation"
   href="https://bugs.llvm.org/show_bug.cgi?id=42857">42857</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>"Function already has body?" assert on explicitly defaulted non-trivial dllexport ctor during explicit template instantiation
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </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>enhancement
          </td>
        </tr>

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

        <tr>
          <th>Component</th>
          <td>LLVM Codegen
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>hans@chromium.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>hans@chromium.org
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>alexandre.ganea@ubisoft.com, llvm-bugs@lists.llvm.org, neeilans@live.com, richard-llvm@metafoo.co.uk
          </td>
        </tr></table>
      <p>
        <div>
        <pre>struct Bar { Bar(); };
template <typename T> struct Foo { __declspec(dllexport) Foo() = default; Bar
b; };
template class Foo<int>;


$ clang -c -target i686-pc-win32 /tmp/b.cc
clang-9: /work/llvm.monorepo/clang/lib/CodeGen/CodeGenFunction.cpp:662: 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.



Reported by Alexandre here: <a href="https://reviews.llvm.org/D65511#1608860">https://reviews.llvm.org/D65511#1608860</a></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>