$ cat test.cpp class a { public: __attribute__((target("avx2"))) __attribute__((__always_inline__)) a(); }; void b() { a c; } $ clang++ test.cpp clang-10: /builddir/build/BUILD/llvm-project-llvmorg-10.0.0/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: /usr/bin/clang-10 -cc1 -triple x86_64-pc-linux-gnu -emit-obj -mrelax-all -disable-free -main-file-name test.cpp -mrelocation-model static -mthread-model posix -mframe-pointer=all -fmath-errno -fno-rounding-math -masm-verbose -mconstructor-aliases -munwind-tables -target-cpu x86-64 -dwarf-column-info -fno-split-dwarf-inlining -debugger-tuning=gdb -resource-dir /usr/lib64/clang/10.0.0 -internal-isystem /usr/bin/../lib64/gcc/x86_64-openmandriva-linux-gnu/10.0.0/../../../../include/c++/10.0.0 -internal-isystem /usr/bin/../lib64/gcc/x86_64-openmandriva-linux-gnu/10.0.0/../../../../include/c++/10.0.0/x86_64-openmandriva-linux-gnu -internal-isystem /usr/bin/../lib64/gcc/x86_64-openmandriva-linux-gnu/10.0.0/../../../../include/c++/10.0.0/backward -internal-isystem /usr/local/include -internal-isystem /usr/lib64/clang/10.0.0/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -fdeprecated-macro -fdebug-compilation-dir /home/bero/temp/abf/botan/BUILD/Botan-2.14.0 -ferror-limit 19 -fmessage-length 0 -fgnuc-version=4.2.1 -fobjc-runtime=gcc -fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics -faddrsig -o /tmp/test-3c3c37.o -x c++ test.cpp 1. <eof> parser at end of file 2. test.cpp:5:6: LLVM IR generation of declaration 'b' 3. test.cpp:5:6: Generating code for declaration 'b' #0 0x00007fc95e551a12 (/usr/lib64/libLLVMSupport.so.10.0+0x214a12) #1 0x00007fc95e54efc0 llvm::sys::RunSignalHandlers() (/usr/lib64/libLLVMSupport.so.10.0+0x211fc0) #2 0x00007fc95e551c28 (/usr/lib64/libLLVMSupport.so.10.0+0x214c28) #3 0x00007fc95dfa8d30 __restore_rt (/lib64/libc.so.6+0x44d30) #4 0x00007fc95dfa8caf raise (/lib64/libc.so.6+0x44caf) #5 0x00007fc95df8953d abort (/lib64/libc.so.6+0x2553d) #6 0x00007fc95df89411 _nl_load_domain.cold (/lib64/libc.so.6+0x25411) #7 0x00007fc95df99c22 (/lib64/libc.so.6+0x35c22) #8 0x00007fc96174759a clang::CodeGen::CodeGenFunction::checkTargetFeatures(clang::SourceLocation, clang::FunctionDecl const*) (/usr/lib64/libclangCodeGen.so.10.0+0x59b59a) #9 0x00007fc9614f5782 clang::CodeGen::CodeGenFunction::EmitCall(clang::CodeGen::CGFunctionInfo const&, clang::CodeGen::CGCallee const&, clang::CodeGen::ReturnValueSlot, clang::CodeGen::CallArgList const&, llvm::CallBase**, clang::SourceLocation) (/usr/lib64/libclangCodeGen.so.10.0+0x349782) #10 0x00007fc961506981 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) (/usr/lib64/libclangCodeGen.so.10.0+0x35a981) #11 0x00007fc961505de4 clang::CodeGen::CodeGenFunction::EmitCXXConstructorCall(clang::CXXConstructorDecl const*, clang::CXXCtorType, bool, bool, clang::CodeGen::AggValueSlot, clang::CXXConstructExpr const*) (/usr/lib64/libclangCodeGen.so.10.0+0x359de4) #12 0x00007fc96159338a clang::CodeGen::CodeGenFunction::EmitCXXConstructExpr(clang::CXXConstructExpr const*, clang::CodeGen::AggValueSlot) (/usr/lib64/libclangCodeGen.so.10.0+0x3e738a) #13 0x00007fc9615895af (/usr/lib64/libclangCodeGen.so.10.0+0x3dd5af) #14 0x00007fc961586217 (/usr/lib64/libclangCodeGen.so.10.0+0x3da217) #15 0x00007fc961583c0e clang::CodeGen::CodeGenFunction::EmitAggExpr(clang::Expr const*, clang::CodeGen::AggValueSlot) (/usr/lib64/libclangCodeGen.so.10.0+0x3d7c0e) #16 0x00007fc961548871 clang::CodeGen::CodeGenFunction::EmitExprAsInit(clang::Expr const*, clang::ValueDecl const*, clang::CodeGen::LValue, bool) (/usr/lib64/libclangCodeGen.so.10.0+0x39c871) #17 0x00007fc96154560d clang::CodeGen::CodeGenFunction::EmitAutoVarInit(clang::CodeGen::CodeGenFunction::AutoVarEmission const&) (/usr/lib64/libclangCodeGen.so.10.0+0x39960d) #18 0x00007fc96153febf clang::CodeGen::CodeGenFunction::EmitVarDecl(clang::VarDecl const&) (/usr/lib64/libclangCodeGen.so.10.0+0x393ebf) #19 0x00007fc96153fb15 clang::CodeGen::CodeGenFunction::EmitDecl(clang::Decl const&) (/usr/lib64/libclangCodeGen.so.10.0+0x393b15) #20 0x00007fc9616e8c2b clang::CodeGen::CodeGenFunction::EmitDeclStmt(clang::DeclStmt const&) (/usr/lib64/libclangCodeGen.so.10.0+0x53cc2b) #21 0x00007fc9616dedaa clang::CodeGen::CodeGenFunction::EmitSimpleStmt(clang::Stmt const*) (/usr/lib64/libclangCodeGen.so.10.0+0x532daa) #22 0x00007fc9616dda07 clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt const*, llvm::ArrayRef<clang::Attr const*>) (/usr/lib64/libclangCodeGen.so.10.0+0x531a07) #23 0x00007fc9616e9ad0 clang::CodeGen::CodeGenFunction::EmitCompoundStmtWithoutScope(clang::CompoundStmt const&, bool, clang::CodeGen::AggValueSlot) (/usr/lib64/libclangCodeGen.so.10.0+0x53dad0) #24 0x00007fc96174209d clang::CodeGen::CodeGenFunction::GenerateCode(clang::GlobalDecl, llvm::Function*, clang::CodeGen::CGFunctionInfo const&) (/usr/lib64/libclangCodeGen.so.10.0+0x59609d) #25 0x00007fc961761f1c clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition(clang::GlobalDecl, llvm::GlobalValue*) (/usr/lib64/libclangCodeGen.so.10.0+0x5b5f1c) #26 0x00007fc961759970 clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl, llvm::GlobalValue*) (/usr/lib64/libclangCodeGen.so.10.0+0x5ad970) #27 0x00007fc96175e708 clang::CodeGen::CodeGenModule::EmitGlobal(clang::GlobalDecl) (/usr/lib64/libclangCodeGen.so.10.0+0x5b2708) #28 0x00007fc9617661ca clang::CodeGen::CodeGenModule::EmitTopLevelDecl(clang::Decl*) (/usr/lib64/libclangCodeGen.so.10.0+0x5ba1ca) #29 0x00007fc9617f354f (/usr/lib64/libclangCodeGen.so.10.0+0x64754f) #30 0x00007fc961736aec (/usr/lib64/libclangCodeGen.so.10.0+0x58aaec) #31 0x00007fc95c13c034 clang::ParseAST(clang::Sema&, bool, bool) (/usr/lib64/libclangParse.so.10.0+0x6c034) #32 0x00007fc961732125 clang::CodeGenAction::ExecuteAction() (/usr/lib64/libclangCodeGen.so.10.0+0x586125) #33 0x00007fc95fd5c94d clang::FrontendAction::Execute() (/usr/lib64/libclangFrontend.so.10.0+0x17194d) #34 0x00007fc95fce414a clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/usr/lib64/libclangFrontend.so.10.0+0xf914a) #35 0x00007fc962160950 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/usr/lib64/libclangFrontendTool.so.10.0+0x5950) #36 0x0000000000217ede cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/usr/bin/clang-10+0x217ede) #37 0x0000000000216016 (/usr/bin/clang-10+0x216016) #38 0x000000000021559c main (/usr/bin/clang-10+0x21559c) #39 0x00007fc95df8addb __libc_start_main (/lib64/libc.so.6+0x26ddb) #40 0x0000000000211aea _start (/usr/bin/clang-10+0x211aea) clang-10: error: unable to execute command: Aborted (core dumped)
(Extracted from real world problem building botan 2.14.0)
Huh, interesting! I'm looking into it.
30588a739584bb8ac41715d68656d22bd85198e7
*** Bug 44919 has been marked as a duplicate of this bug. ***