Closed
Description
Given the following
class B{
virtual constexpr ~B() = 0;
};
class D : B{};
Example godbolt: https://godbolt.org/z/91zohzbeT
clang++: /root/llvm-project/clang/lib/Sema/SemaDeclCXX.cpp:13781: void clang::Sema::DefineImplicitDestructor(clang::SourceLocation, clang::CXXDestructorDecl*): Assertion `(Destructor->isDefaulted() && !Destructor->doesThisDeclarationHaveABody() && !Destructor->isDeleted()) && "DefineImplicitDestructor - call it for implicit default dtor"' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0. Program arguments: /opt/compiler-explorer/clang-assertions-trunk/bin/clang++ -gdwarf-4 -g -o /app/output.s -mllvm --x86-asm-syntax=intel -S --gcc-toolchain=/opt/compiler-explorer/gcc-snapshot -fcolor-diagnostics -fno-crash-diagnostics -std=c++20 <source>
1. <source>:5:14: current parser token ';'
2. <source>:5:1: parsing struct/union/class body 'D'
#0 0x000055f67e5d81a4 PrintStackTraceSignalHandler(void*) Signals.cpp:0:0
#1 0x000055f67e5d5f4c llvm::sys::CleanupOnSignal(unsigned long) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x3e71f4c)
#2 0x000055f67e50cf78 CrashRecoverySignalHandler(int) CrashRecoveryContext.cpp:0:0
#3 0x00007ffa4ef8b420 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x14420)
#4 0x00007ffa4ea5800b raise (/lib/x86_64-linux-gnu/libc.so.6+0x4300b)
#5 0x00007ffa4ea37859 abort (/lib/x86_64-linux-gnu/libc.so.6+0x22859)
#6 0x00007ffa4ea37729 (/lib/x86_64-linux-gnu/libc.so.6+0x22729)
#7 0x00007ffa4ea48fd6 (/lib/x86_64-linux-gnu/libc.so.6+0x33fd6)
#8 0x000055f680f83881 clang::Sema::DefineImplicitDestructor(clang::SourceLocation, clang::CXXDestructorDecl*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x681f881)
#9 0x000055f680f84989 clang::Sema::CheckCompletedCXXClass(clang::Scope*, clang::CXXRecordDecl*)::'lambda1'(clang::CXXMethodDecl*)::operator()(clang::CXXMethodDecl*) const SemaDeclCXX.cpp:0:0
#10 0x000055f680f85138 clang::Sema::CheckCompletedCXXClass(clang::Scope*, clang::CXXRecordDecl*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6821138)
#11 0x000055f680f86e4a clang::Sema::ActOnFinishCXXMemberSpecification(clang::Scope*, clang::SourceLocation, clang::Decl*, clang::SourceLocation, clang::SourceLocation, clang::ParsedAttributesView const&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6822e4a)
#12 0x000055f680be7963 clang::Parser::ParseCXXMemberSpecification(clang::SourceLocation, clang::SourceLocation, clang::ParsedAttributes&, unsigned int, clang::Decl*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6483963)
#13 0x000055f680be9b43 clang::Parser::ParseClassSpecifier(clang::tok::TokenKind, clang::SourceLocation, clang::DeclSpec&, clang::Parser::ParsedTemplateInfo const&, clang::AccessSpecifier, bool, clang::Parser::DeclSpecContext, clang::ParsedAttributes&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6485b43)
#14 0x000055f680bc655b clang::Parser::ParseDeclarationSpecifiers(clang::DeclSpec&, clang::Parser::ParsedTemplateInfo const&, clang::AccessSpecifier, clang::Parser::DeclSpecContext, clang::Parser::LateParsedAttrList*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x646255b)
#15 0x000055f680b9111c clang::Parser::ParseDeclOrFunctionDefInternal(clang::ParsedAttributes&, clang::ParsingDeclSpec&, clang::AccessSpecifier) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x642d11c)
#16 0x000055f680b919e0 clang::Parser::ParseDeclarationOrFunctionDefinition(clang::ParsedAttributes&, clang::ParsingDeclSpec*, clang::AccessSpecifier) (.part.0) Parser.cpp:0:0
#17 0x000055f680b9719b clang::Parser::ParseExternalDeclaration(clang::ParsedAttributes&, clang::ParsingDeclSpec*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x643319b)
#18 0x000055f680b9802a clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, clang::Sema::ModuleImportState&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x643402a)
#19 0x000055f680b8c49a clang::ParseAST(clang::Sema&, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x642849a)
#20 0x000055f67f8e42c8 clang::CodeGenAction::ExecuteAction() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x51802c8)
#21 0x000055f67f17fdb9 clang::FrontendAction::Execute() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x4a1bdb9)
#22 0x000055f67f1085ee clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x49a45ee)
#23 0x000055f67f2601f3 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x4afc1f3)
#24 0x000055f67bb56714 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x13f2714)
#25 0x000055f67bb4f848 ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&) driver.cpp:0:0
#26 0x000055f67ef77089 void llvm::function_ref<void ()>::callback_fn<clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, bool*) const::'lambda'()>(long) Job.cpp:0:0
#27 0x000055f67e50d71a llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x3da971a)
#28 0x000055f67ef7779f clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, bool*) const (.part.0) Job.cpp:0:0
#29 0x000055f67ef40ca9 clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x47dcca9)
#30 0x000055f67ef4172d clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&, bool) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x47dd72d)
#31 0x000055f67ef4b4dc clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x47e74dc)
#32 0x000055f67bb54af3 clang_main(int, char**) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x13f0af3)
#33 0x00007ffa4ea39083 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x24083)
#34 0x000055f67bb4f43e _start (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x13eb43e)
clang-16: error: clang frontend command failed with exit code 134 (use -v to see invocation)
Compiler returned: 134