[llvm-bugs] [Bug 47683] New: Constructor for template class codegen'd multiple times with dllexport explicit instantiation

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Sep 29 14:50:28 PDT 2020


https://bugs.llvm.org/show_bug.cgi?id=47683

            Bug ID: 47683
           Summary: Constructor for template class codegen'd multiple
                    times with dllexport explicit instantiation
           Product: new-bugs
           Version: unspecified
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: aeubanks at google.com
                CC: hans at chromium.org, htmldeveloper at gmail.com,
                    llvm-bugs at lists.llvm.org, rnk at google.com

$ 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.


https://bugs.llvm.org/show_bug.cgi?id=42857 seems related.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20200929/87da201f/attachment.html>


More information about the llvm-bugs mailing list