[llvm-bugs] [Bug 42857] New: "Function already has body?" assert on explicitly defaulted non-trivial dllexport ctor during explicit template instantiation

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Aug 1 00:44:10 PDT 2019


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

            Bug ID: 42857
           Summary: "Function already has body?" assert on explicitly
                    defaulted non-trivial dllexport ctor during explicit
                    template instantiation
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: LLVM Codegen
          Assignee: hans at chromium.org
          Reporter: hans at chromium.org
                CC: alexandre.ganea at ubisoft.com, llvm-bugs at lists.llvm.org,
                    neeilans at live.com, richard-llvm at metafoo.co.uk

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: https://reviews.llvm.org/D65511#1608860

-- 
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/20190801/a37e535c/attachment.html>


More information about the llvm-bugs mailing list