Issue 209000
Summary [clang] Assertion `!TypeSpecOwned || isDeclRep((TST)TypeSpecType)' failed.
Labels clang:frontend, crash-on-invalid, generated by fuzzer
Assignees
Reporter k-arrows
    Reproducer:
https://godbolt.org/z/ndMG91nvc
```cpp
struct S {
} auto;
```

Backtrace:
```console
clang++: /root/llvm-project/llvm/tools/clang/lib/Sema/DeclSpec.cpp:1173: void clang::DeclSpec::Finish(clang::Sema&, const clang::PrintingPolicy&): Assertion `!TypeSpecOwned || isDeclRep((TST)TypeSpecType)' 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 <source>
1.	<source>:2:7: current parser token ';'
 #0 0x000000000439f6e8 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x439f6e8)
 #1 0x000000000439c5a4 llvm::sys::RunSignalHandlers() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x439c5a4)
 #2 0x000000000439cbcc llvm::sys::CleanupOnSignal(unsigned long) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x439cbcc)
 #3 0x00000000042dbc18 CrashRecoverySignalHandler(int) CrashRecoveryContext.cpp:0:0
 #4 0x0000713083a45330 (/lib/x86_64-linux-gnu/libc.so.6+0x45330)
 #5 0x0000713083a9eb2c pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x9eb2c)
 #6 0x0000713083a4527e raise (/lib/x86_64-linux-gnu/libc.so.6+0x4527e)
 #7 0x0000713083a288ff abort (/lib/x86_64-linux-gnu/libc.so.6+0x288ff)
 #8 0x0000713083a2881b (/lib/x86_64-linux-gnu/libc.so.6+0x2881b)
 #9 0x0000713083a3b517 (/lib/x86_64-linux-gnu/libc.so.6+0x3b517)
#10 0x0000000006dd3917 (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6dd3917)
#11 0x0000000006ccdcf1 clang::Parser::ParseDeclarationSpecifiers(clang::DeclSpec&, clang::Parser::ParsedTemplateInfo&, clang::AccessSpecifier, clang::Parser::DeclSpecContext, clang::LateParsedAttrList*, clang::ImplicitTypenameContext) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6ccdcf1)
#12 0x0000000006c8ad97 clang::Parser::ParseDeclOrFunctionDefInternal(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec&, clang::AccessSpecifier) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6c8ad97)
#13 0x0000000006c8b80f clang::Parser::ParseDeclarationOrFunctionDefinition(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*, clang::AccessSpecifier) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6c8b80f)
#14 0x0000000006c98021 clang::Parser::ParseExternalDeclaration(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6c98021)
#15 0x0000000006c98f35 clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, clang::Sema::ModuleImportState&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6c98f35)
#16 0x0000000006c99320 clang::Parser::ParseFirstTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, clang::Sema::ModuleImportState&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6c99320)
#17 0x0000000006c75e13 clang::ParseAST(clang::Sema&, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6c75e13)
#18 0x0000000004e9a808 clang::CodeGenAction::ExecuteAction() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x4e9a808)
#19 0x00000000051c55d8 clang::FrontendAction::Execute() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x51c55d8)
#20 0x00000000051532ed clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x51532ed)
#21 0x000000000529dd0d clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x529dd0d)
#22 0x0000000000db78ac cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0xdb78ac)
#23 0x0000000000dae4ba ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&, llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem>) driver.cpp:0:0
#24 0x0000000000dae63d 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
#25 0x0000000004f119f9 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
#26 0x00000000042dc054 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x42dc054)
#27 0x0000000004f12565 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
#28 0x0000000004ecb012 clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x4ecb012)
#29 0x0000000004ecf847 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+++0x4ecf847)
#30 0x0000000004ed9d35 clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x4ed9d35)
#31 0x0000000000db3d9a clang_main(int, char**, llvm::ToolContext const&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0xdb3d9a)
#32 0x0000000000cd008a main (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0xcd008a)
#33 0x0000713083a2a1ca (/lib/x86_64-linux-gnu/libc.so.6+0x2a1ca)
#34 0x0000713083a2a28b __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2a28b)
#35 0x0000000000dade65 _start (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0xdade65)
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

Reply via email to