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: h...@chromium.org
          Reporter: h...@chromium.org
                CC: alexandre.ga...@ubisoft.com, llvm-bugs@lists.llvm.org,
                    neeil...@live.com, richard-l...@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.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to