[llvm-bugs] [Bug 44919] New: Assertion `!isa<CXXConstructorDecl>(D) && "Use other ctor with ctor decls!"' failed.

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Feb 14 14:38:49 PST 2020


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

            Bug ID: 44919
           Summary: Assertion `!isa<CXXConstructorDecl>(D) && "Use other
                    ctor with ctor decls!"' failed.
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: rupprecht at google.com
                CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org,
                    neeilans at live.com, richard-llvm at metafoo.co.uk

This assertion is failing for me at head with this reduced repro (using a debug
build of clang):

$ cat repro.cc 
template <typename>
class b {
  __attribute__((target("avx"))) void c();
};
class B {
 public:
  __attribute__((target("avx"))) __attribute__((always_inline)) B();
};
template <typename d>
void b<d>::c() {
  B a;
}
template class b<int>;

$ clang++ -c repro.cc
clang++: llvm-project/clang/include/clang/AST/GlobalDecl.h:45: void
clang::GlobalDecl::Init(const clang::Decl *): Assertion
`!isa<CXXConstructorDecl>(D) && "Use other ctor with ctor decls!"' failed.
Stack dump:
0.      Program arguments: clang++ -c repro.cc
1.      repro.cc:13:22: current parser token ';'
2.      repro.cc:3:39: instantiating function definition 'b<int>::c'
3.      repro.cc:3:39: LLVM IR generation of declaration 'b<int>::c'
4.      repro.cc:3:39: Generating code for declaration 'b<int>::c'
 #0 0x0000000007f89b17 llvm::sys::PrintStackTrace(llvm::raw_ostream&)
llvm-project/llvm/lib/Support/Unix/Signals.inc:564:11
... <irrelevant stack unwinding> ...
#11 0x00000000082d580f clang::GlobalDecl::Init(clang::Decl const*)
llvm-project/clang/include/clang/AST/GlobalDecl.h:46:5
#12 0x00000000082ded19 clang::GlobalDecl::GlobalDecl(clang::FunctionDecl
const*, unsigned int) llvm-project/clang/include/clang/AST/GlobalDecl.h:57:3
#13 0x0000000008615705
clang::CodeGen::CodeGenFunction::checkTargetFeatures(clang::SourceLocation,
clang::FunctionDecl const*)
llvm-project/clang/lib/CodeGen/CodeGenFunction.cpp:2351:22
#14 0x000000000842a99d
clang::CodeGen::CodeGenFunction::EmitCall(clang::CodeGen::CGFunctionInfo
const&, clang::CodeGen::CGCallee const&, clang::CodeGen::ReturnValueSlot,
clang::CodeGen::CallArgList const&, llvm::CallBase**, clang::SourceLocation)
llvm-project/clang/lib/CodeGen/CGCall.cpp:3977:41
#15 0x00000000085e0d53
clang::CodeGen::CodeGenFunction::EmitCall(clang::CodeGen::CGFunctionInfo
const&, clang::CodeGen::CGCallee const&, clang::CodeGen::ReturnValueSlot,
clang::CodeGen::CallArgList const&, llvm::CallBase**)
llvm-project/clang/lib/CodeGen/CodeGenFunction.h:3621:12
#16 0x000000000862c70b
clang::CodeGen::CodeGenFunction::EmitCXXConstructorCall(clang::CXXConstructorDecl
const*, clang::CXXCtorType, bool, bool, clang::CodeGen::Address,
clang::CodeGen::CallArgList&, clang::CodeGen::AggValueSlot::Overlap_t,
clang::SourceLocation, bool) llvm-project/clang/lib/CodeGen/CGClass.cpp:2177:3
#17 0x000000000862be8e
clang::CodeGen::CodeGenFunction::EmitCXXConstructorCall(clang::CXXConstructorDecl
const*, clang::CXXCtorType, bool, bool, clang::CodeGen::AggValueSlot,
clang::CXXConstructExpr const*)
llvm-project/clang/lib/CodeGen/CGClass.cpp:2094:1
#18 0x00000000087c2e2e
clang::CodeGen::CodeGenFunction::EmitCXXConstructExpr(clang::CXXConstructExpr
const*, clang::CodeGen::AggValueSlot)
llvm-project/clang/lib/CodeGen/CGExprCXX.cpp:651:1
#19 0x000000000877dc7e (anonymous
namespace)::AggExprEmitter::VisitCXXConstructExpr(clang::CXXConstructExpr
const*) llvm-project/clang/lib/CodeGen/CGExprAgg.cpp:1269:1
#20 0x0000000008779b90 clang::StmtVisitorBase<std::add_pointer, (anonymous
namespace)::AggExprEmitter, void>::Visit(clang::Stmt*)
llvm-build/dev/tools/clang/include/clang/AST/StmtNodes.inc:679:1
#21 0x00000000087777ab (anonymous
namespace)::AggExprEmitter::Visit(clang::Expr*)
llvm-project/clang/lib/CodeGen/CGExprAgg.cpp:107:3
#22 0x00000000087773b4 clang::CodeGen::CodeGenFunction::EmitAggExpr(clang::Expr
const*, clang::CodeGen::AggValueSlot)
llvm-project/clang/lib/CodeGen/CGExprAgg.cpp:1849:1
...

-- 
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/20200214/dbf1a87a/attachment-0001.html>


More information about the llvm-bugs mailing list