| Issue |
183887
|
| Summary |
[Clang] assertion failure when parsing invalid declaration with explicit(...) and enum
|
| Labels |
clang
|
| Assignees |
|
| Reporter |
YuchangSu
|
Code:
```
enum a explicit(a()
```
See Compiler Explorer: [https://godbolt.org/z/741bcxcMW](https://godbolt.org/z/741bcxcMW)
Regression since Clang 12.0.0
Backtrace:
```
#0 0x000000000440ac38 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x440ac38)
#1 0x0000000004408084 llvm::sys::CleanupOnSignal(unsigned long) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x4408084)
#2 0x0000000004347e88 CrashRecoverySignalHandler(int) CrashRecoveryContext.cpp:0:0
#3 0x00007feec3842520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
#4 0x00007feec38969fc pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x969fc)
#5 0x00007feec3842476 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x42476)
#6 0x00007feec38287f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3)
#7 0x00007feec382871b (/lib/x86_64-linux-gnu/libc.so.6+0x2871b)
#8 0x00007feec3839e96 (/lib/x86_64-linux-gnu/libc.so.6+0x39e96)
#9 0x000000000721c73c clang::Sema::PerformImplicitConversion(clang::Expr*, clang::QualType, clang::StandardConversionSequence const&, clang::AssignmentAction, clang::CheckedConversionKind) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x721c73c)
#10 0x000000000721cb8a clang::Sema::PerformImplicitConversion(clang::Expr*, clang::QualType, clang::ImplicitConversionSequence const&, clang::AssignmentAction, clang::CheckedConversionKind) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x721cb8a)
#11 0x000000000751350c BuildConvertedConstantExpression(clang::Sema&, clang::Expr*, clang::QualType, clang::CCEKind, clang::NamedDecl*, clang::APValue&) SemaOverload.cpp:0:0
#12 0x0000000007513904 clang::Sema::CheckConvertedConstantExpression(clang::Expr*, clang::QualType, llvm::APSInt&, clang::CCEKind) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x7513904)
#13 0x0000000007037cd8 clang::Sema::tryResolveExplicitSpecifier(clang::ExplicitSpecifier&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x7037cd8)
#14 0x0000000007037dea clang::Sema::ActOnExplicitBoolSpecifier(clang::Expr*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x7037dea)
#15 0x0000000006c2b938 clang::Parser::ParseDeclarationSpecifiers(clang::DeclSpec&, clang::Parser::ParsedTemplateInfo&, clang::AccessSpecifier, clang::Parser::DeclSpecContext, clang::Parser::LateParsedAttrList*, clang::ImplicitTypenameContext) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6c2b938)
#16 0x0000000006be4937 clang::Parser::ParseDeclOrFunctionDefInternal(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec&, clang::AccessSpecifier) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6be4937)
#17 0x0000000006be53bf clang::Parser::ParseDeclarationOrFunctionDefinition(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*, clang::AccessSpecifier) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6be53bf)
#18 0x0000000006bec9c1 clang::Parser::ParseExternalDeclaration(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6bec9c1)
#19 0x0000000006bed8f5 clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, clang::Sema::ModuleImportState&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6bed8f5)
#20 0x0000000006bedce0 clang::Parser::ParseFirstTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, clang::Sema::ModuleImportState&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6bedce0)
#21 0x0000000006bcefa3 clang::ParseAST(clang::Sema&, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6bcefa3)
#22 0x0000000004ee4ef8 clang::CodeGenAction::ExecuteAction() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x4ee4ef8)
#23 0x00000000051eb615 clang::FrontendAction::Execute() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x51eb615)
#24 0x00000000051698fe clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x51698fe)
#25 0x00000000052e72dd clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x52e72dd)
#26 0x0000000000df063e cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0xdf063e)
#27 0x0000000000de6faa ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&, llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem>) driver.cpp:0:0
#28 0x0000000000de712d int llvm::function_ref<int (llvm::SmallVectorImpl<char const*>&)>::callback_fn<clang_main(int, char**, llvm::ToolContext const&)::'lambda'(llvm::SmallVectorImpl<char const*>&)>(long, llvm::SmallVectorImpl<char const*>&) driver.cpp:0:0
#29 0x0000000004f59659 void llvm::function_ref<void ()>::callback_fn<clang::driver::CC1Command::Execute(llvm::ArrayRef<std::optional<llvm::StringRef>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, bool*) const::'lambda'()>(long) Job.cpp:0:0
#30 0x00000000043482c4 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x43482c4)
#31 0x0000000004f59c6f clang::driver::CC1Command::Execute(llvm::ArrayRef<std::optional<llvm::StringRef>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, bool*) const (.part.0) Job.cpp:0:0
#32 0x0000000004f19952 clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x4f19952)
#33 0x0000000004f1a8fe 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+++0x4f1a8fe)
#34 0x0000000004f22645 clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x4f22645)
#35 0x0000000000dec9ae clang_main(int, char**, llvm::ToolContext const&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0xdec9ae)
#36 0x0000000000ca4d0a main (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0xca4d0a)
#37 0x00007feec3829d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#38 0x00007feec3829e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#39 0x0000000000de6a45 _start (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0xde6a45)
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs