Issue 239962
Summary [clang][OpenACC] Assertion `DD && "queried property of class with no definition"' failed.
Labels clang:frontend, crash, clang:openacc, generated by fuzzer
Assignees
Reporter k-arrows
    Reproducer:
https://godbolt.org/z/EdjbG71fa
```cpp
struct foo;

struct S {
  using iterator_category = foo;
};

void bar() {
#pragma acc loop
  for (S s;;)
 ;
}
```

Backtrace:
```console
clang++: /root/llvm-project/llvm/tools/clang/include/clang/AST/DeclCXX.h:464: clang::CXXRecordDecl::DefinitionData& clang::CXXRecordDecl::data() const: Assertion `DD && "queried property of class with no definition"' 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 -fopenacc <source>
1.	<source>:10:5: current parser token ';'
2.	<source>:7:12: parsing function body 'bar'
3.	<source>:7:12: in compound statement ('{}')
 #0 0x0000000004f29778 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x4f29778)
 #1 0x0000000004f269d4 llvm::sys::RunSignalHandlers() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x4f269d4)
 #2 0x0000000004f2700c llvm::sys::CleanupOnSignal(unsigned long) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x4f2700c)
 #3 0x0000000004e61188 CrashRecoverySignalHandler(int) CrashRecoveryContext.cpp:0:0
 #4 0x00007d73d0645330 (/lib/x86_64-linux-gnu/libc.so.6+0x45330)
 #5 0x00007d73d069ec0c pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x9ec0c)
 #6 0x00007d73d064527e raise (/lib/x86_64-linux-gnu/libc.so.6+0x4527e)
 #7 0x00007d73d06288ff abort (/lib/x86_64-linux-gnu/libc.so.6+0x288ff)
 #8 0x00007d73d062881b (/lib/x86_64-linux-gnu/libc.so.6+0x2881b)
 #9 0x00007d73d063b517 (/lib/x86_64-linux-gnu/libc.so.6+0x3b517)
#10 0x000000000535ffbc clang::CXXRecordDecl::data() const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x535ffbc)
#11 0x00000000097ad288 (anonymous namespace)::isValidLoopVariableType(clang::QualType) SemaOpenACC.cpp:0:0
#12 0x00000000097ba04c clang::SemaOpenACC::ForStmtBeginChecker::checkForInit(clang::Stmt const*, clang::ValueDecl const*&, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x97ba04c)
#13 0x00000000097ba974 clang::SemaOpenACC::ForStmtBeginChecker::checkFor() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x97ba974)
#14 0x00000000097bb137 clang::SemaOpenACC::ActOnForStmtBegin(clang::SourceLocation, clang::Stmt const*, clang::Stmt const*, clang::Stmt const*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x97bb137)
#15 0x00000000090f1e9d clang::Parser::ParseForStatement(clang::SourceLocation*, clang::LabelDecl*, clang::CXXExpansionStmtDecl*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x90f1e9d)
#16 0x00000000090eeaaf clang::Parser::ParseStatementOrDeclarationAfterAttributes(llvm::SmallVector<clang::Stmt*, 24u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*, clang::ParsedAttributes&, clang::ParsedAttributes&, clang::LabelDecl*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x90eeaaf)
#17 0x00000000090efe86 clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector<clang::Stmt*, 24u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*, clang::LabelDecl*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x90efe86)
#18 0x00000000090f0e1b clang::Parser::ParseStatement(clang::SourceLocation*, clang::Parser::ParsedStmtContext, clang::LabelDecl*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x90f0e1b)
#19 0x0000000008ffdbe6 clang::Parser::ParseOpenACCDirectiveStmt() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x8ffdbe6)
#20 0x00000000090ef07f clang::Parser::ParseStatementOrDeclarationAfterAttributes(llvm::SmallVector<clang::Stmt*, 24u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*, clang::ParsedAttributes&, clang::ParsedAttributes&, clang::LabelDecl*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x90ef07f)
#21 0x00000000090efe86 clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector<clang::Stmt*, 24u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*, clang::LabelDecl*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x90efe86)
#22 0x00000000090f845e clang::Parser::ParseCompoundStatementBody(bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x90f845e)
#23 0x00000000090f8c4a clang::Parser::ParseFunctionStatementBody(clang::Decl*, clang::Parser::ParseScope&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x90f8c4a)
#24 0x0000000008fee9ee clang::Parser::ParseFunctionDefinition(clang::ParsingDeclarator&, clang::Parser::ParsedTemplateInfo const&, clang::LateParsedAttrList*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x8fee9ee)
#25 0x000000000903ac86 clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&, clang::DeclaratorContext, clang::ParsedAttributes&, clang::Parser::ParsedTemplateInfo&, clang::SourceLocation*, clang::Parser::ForRangeInit*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x903ac86)
#26 0x0000000008fe25bb clang::Parser::ParseDeclOrFunctionDefInternal(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec&, clang::AccessSpecifier) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x8fe25bb)
#27 0x0000000008fe2dff clang::Parser::ParseDeclarationOrFunctionDefinition(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*, clang::AccessSpecifier) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x8fe2dff)
#28 0x0000000008fefd28 clang::Parser::ParseExternalDeclaration(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x8fefd28)
#29 0x0000000008ff0c45 clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, clang::Sema::ModuleImportState&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x8ff0c45)
#30 0x0000000008fccc0a clang::ParseAST(clang::Sema&, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x8fccc0a)
#31 0x0000000005a28d78 clang::CodeGenAction::ExecuteAction() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x5a28d78)
#32 0x0000000005d510c8 clang::FrontendAction::Execute() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x5d510c8)
#33 0x0000000005cddc1d clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x5cddc1d)
#34 0x0000000005e27843 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x5e27843)
#35 0x000000000171b2f8 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x171b2f8)
#36 0x00000000017121da ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&, llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem>) driver.cpp:0:0
#37 0x0000000001712363 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
#38 0x0000000005aa0f69 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
#39 0x0000000004e61584 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x4e61584)
#40 0x0000000005aa1ad5 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
#41 0x0000000005a5e8f2 clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x5a5e8f2)
#42 0x0000000005a61bac 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+++0x5a61bac)
#43 0x0000000005a6e0a5 clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x5a6e0a5)
#44 0x000000000171792a clang_main(int, char**, llvm::ToolContext const&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x171792a)
#45 0x00000000016908b3 main (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x16908b3)
#46 0x00007d73d062a1ca (/lib/x86_64-linux-gnu/libc.so.6+0x2a1ca)
#47 0x00007d73d062a28b __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2a28b)
#48 0x0000000001711b85 _start (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x1711b85)
clang++: error: clang frontend command failed due to signal (use -v to see invocation)
Program terminated with signal SIGABRT (6)
Compiler returned: 134
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to