| Issue |
203701
|
| Summary |
[clang] Assertion `Name.isIdentifier() && "Name is not a simple identifier"' failed.
|
| Labels |
clang:frontend,
crash,
generated by fuzzer
|
| Assignees |
|
| Reporter |
k-arrows
|
Reproducer:
https://godbolt.org/z/dxjfbobdE
```cpp
struct S {
constexpr S(auto) {}
};
constexpr auto a = [](this S) { return 1; };
static_assert((&decltype(a)::operator())(1) == 42);
```
Backtrace:
```console
clang++: /root/llvm-project/llvm/tools/clang/include/clang/AST/Decl.h:302: llvm::StringRef clang::NamedDecl::getName() const: Assertion `Name.isIdentifier() && "Name is not a simple identifier"' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace and dumped files.
Stack dump:
0. Program arguments: /opt/compiler-explorer/clang-assertions-trunk/bin/clang++ -g -o /app/output.s -mllvm --x86-asm-syntax=intel -fno-verbose-asm -S --gcc-toolchain=/opt/compiler-explorer/gcc-snapshot -fcolor-diagnostics -fno-crash-diagnostics -std=c++2b <source>
1. <eof> parser at end of file
#0 0x000000000439c808 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x439c808)
#1 0x0000000004399644 llvm::sys::RunSignalHandlers() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x4399644)
#2 0x0000000004399c64 llvm::sys::CleanupOnSignal(unsigned long) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x4399c64)
#3 0x00000000042d6468 CrashRecoverySignalHandler(int) CrashRecoveryContext.cpp:0:0
#4 0x000076c74b445330 (/lib/x86_64-linux-gnu/libc.so.6+0x45330)
#5 0x000076c74b49eb2c pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x9eb2c)
#6 0x000076c74b44527e raise (/lib/x86_64-linux-gnu/libc.so.6+0x4527e)
#7 0x000076c74b4288ff abort (/lib/x86_64-linux-gnu/libc.so.6+0x288ff)
#8 0x000076c74b42881b (/lib/x86_64-linux-gnu/libc.so.6+0x2881b)
#9 0x000076c74b43b517 (/lib/x86_64-linux-gnu/libc.so.6+0x3b517)
#10 0x000000000765b3db (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x765b3db)
#11 0x0000000008412419 (anonymous namespace)::StmtPrinter::Visit(clang::Stmt*) StmtPrinter.cpp:0:0
#12 0x0000000008415671 (anonymous namespace)::StmtPrinter::VisitUnaryOperator(clang::UnaryOperator*) StmtPrinter.cpp:0:0
#13 0x00000000084124b9 (anonymous namespace)::StmtPrinter::Visit(clang::Stmt*) StmtPrinter.cpp:0:0
#14 0x0000000008416088 (anonymous namespace)::StmtPrinter::VisitParenExpr(clang::ParenExpr*) StmtPrinter.cpp:0:0
#15 0x0000000008413e2d (anonymous namespace)::StmtPrinter::Visit(clang::Stmt*) StmtPrinter.cpp:0:0
#16 0x0000000008418ce8 (anonymous namespace)::StmtPrinter::VisitCallExpr(clang::CallExpr*) StmtPrinter.cpp:0:0
#17 0x0000000008413a01 (anonymous namespace)::StmtPrinter::Visit(clang::Stmt*) StmtPrinter.cpp:0:0
#18 0x000000000841b09d (anonymous namespace)::StmtPrinter::VisitBinaryOperator(clang::BinaryOperator*) StmtPrinter.cpp:0:0
#19 0x000000000841245d (anonymous namespace)::StmtPrinter::Visit(clang::Stmt*) StmtPrinter.cpp:0:0
#20 0x0000000008414ac4 clang::Stmt::printPretty(llvm::raw_ostream&, clang::PrinterHelper*, clang::PrintingPolicy const&, unsigned int, llvm::StringRef, clang::ASTContext const*) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x8414ac4)
#21 0x0000000007660489 clang::Sema::findFailedBooleanCondition[abi:cxx11](clang::Expr*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x7660489)
#22 0x00000000070db6e0 clang::Sema::BuildStaticAssertDeclaration(clang::SourceLocation, clang::Expr*, clang::Expr*, clang::SourceLocation, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x70db6e0)
#23 0x0000000006cb723b clang::Parser::ParseStaticAssertDeclaration(clang::SourceLocation&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6cb723b)
#24 0x0000000006ca59a6 clang::Parser::ParseDeclaration(clang::DeclaratorContext, clang::SourceLocation&, clang::ParsedAttributes&, clang::ParsedAttributes&, clang::SourceLocation*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6ca59a6)
#25 0x0000000006c61556 clang::Parser::ParseExternalDeclaration(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6c61556)
#26 0x0000000006c62445 clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, clang::Sema::ModuleImportState&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6c62445)
#27 0x0000000006c4332a clang::ParseAST(clang::Sema&, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6c4332a)
#28 0x0000000004e8b1a8 clang::CodeGenAction::ExecuteAction() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x4e8b1a8)
#29 0x00000000051c1a98 clang::FrontendAction::Execute() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x51c1a98)
#30 0x000000000513ee9d clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x513ee9d)
#31 0x00000000052c070d clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x52c070d)
#32 0x0000000000e2176c cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0xe2176c)
#33 0x0000000000e1840a ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&, llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem>) driver.cpp:0:0
#34 0x0000000000e1858d 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
#35 0x0000000004efda49 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
#36 0x00000000042d68a4 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x42d68a4)
#37 0x0000000004efe096 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
#38 0x0000000004eba9c2 clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x4eba9c2)
#39 0x0000000004ebb96e 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+++0x4ebb96e)
#40 0x0000000004ec31a5 clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x4ec31a5)
#41 0x0000000000e1dca2 clang_main(int, char**, llvm::ToolContext const&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0xe1dca2)
#42 0x0000000000cc3e1a main (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0xcc3e1a)
#43 0x000076c74b42a1ca (/lib/x86_64-linux-gnu/libc.so.6+0x2a1ca)
#44 0x000076c74b42a28b __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2a28b)
#45 0x0000000000e17db5 _start (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0xe17db5)
clang++: error: clang frontend command failed due to signal (use -v to see invocation)
Compiler returned: 134
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs