<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/63527>63527</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            `clangtk` crashes at clang::StmtVisitorBase<llvm::make_const_ptr, (anonymous namespace)::StmtProfiler, void>::Visit(clang::Stmt const*)
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          wierton
      </td>
    </tr>
</table>

<pre>
    The bug triggering program:
```
void a(void) {}
void b(void) {
  int c = 0, d = 0;
#pragma omp atomic capture
  {
    d = c;
    c = a();
  }
}
```

When attempting to compile it using `clangtk` with option `-O0 -fopenmp-simd`, `clangtk` crashes with below output log (verification link: https://gcc.godbolt.org/z/9TohYb7T6):
```
<source>:7:7: error: assigning to 'int' from incompatible type 'void'
    7 |     c = a();
 |       ^ ~~~
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-trunk/bin/clang -gdwarf-4 -g -o /app/output.s -S --gcc-toolchain=/opt/compiler-explorer/gcc-9.2.0 -fcolor-diagnostics -fno-crash-diagnostics -O0 -fopenmp-simd <source>
1.      <source>:9:1: current parser token '}'
2.      <source>:2:14: parsing function body 'b'
3.      <source>:2:14: in compound statement ('{}')
 #0 0x000055afe082616f llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-trunk/bin/clang+0x362e16f)
 #1 0x000055afe082419c llvm::sys::CleanupOnSignal(unsigned long) (/opt/compiler-explorer/clang-trunk/bin/clang+0x362c19c)
 #2 0x000055afe0773e58 CrashRecoverySignalHandler(int) CrashRecoveryContext.cpp:0:0
 #3 0x00007f97553a7420 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x14420)
 #4 0x000055afe403d35b clang::StmtVisitorBase<llvm::make_const_ptr, (anonymous namespace)::StmtProfiler, void>::Visit(clang::Stmt const*) StmtProfile.cpp:0:0
 #5 0x000055afe40434ef clang::Stmt::Profile(llvm::FoldingSetNodeID&, clang::ASTContext const&, bool) const (/opt/compiler-explorer/clang-trunk/bin/clang+0x6e4b4ef)
 #6 0x000055afe357976c clang::Sema::ActOnOpenMPAtomicDirective(llvm::ArrayRef<clang::OMPClause*>, clang::Stmt*, clang::SourceLocation, clang::SourceLocation) (/opt/compiler-explorer/clang-trunk/bin/clang+0x638176c)
 #7 0x000055afe35fe1bc clang::Sema::ActOnOpenMPExecutableDirective(llvm::omp::Directive, clang::DeclarationNameInfo const&, llvm::omp::Directive, llvm::ArrayRef<clang::OMPClause*>, clang::Stmt*, clang::SourceLocation, clang::SourceLocation) (/opt/compiler-explorer/clang-trunk/bin/clang+0x64061bc)
 #8 0x000055afe2e45612 clang::Parser::ParseOpenMPDeclarativeOrExecutableDirective(clang::Parser::ParsedStmtContext, bool) (/opt/compiler-explorer/clang-trunk/bin/clang+0x5c4d612)
 #9 0x000055afe2e6750c clang::Parser::ParseStatementOrDeclarationAfterAttributes(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*, clang::ParsedAttributes&, clang::ParsedAttributes&) (/opt/compiler-explorer/clang-trunk/bin/clang+0x5c6f50c)
#10 0x000055afe2e69181 clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*) (/opt/compiler-explorer/clang-trunk/bin/clang+0x5c71181)
#11 0x000055afe2e69ff9 clang::Parser::ParseCompoundStatementBody(bool) (/opt/compiler-explorer/clang-trunk/bin/clang+0x5c71ff9)
#12 0x000055afe2e6c2e2 clang::Parser::ParseFunctionStatementBody(clang::Decl*, clang::Parser::ParseScope&) (/opt/compiler-explorer/clang-trunk/bin/clang+0x5c742e2)
#13 0x000055afe2d878d0 clang::Parser::ParseFunctionDefinition(clang::ParsingDeclarator&, clang::Parser::ParsedTemplateInfo const&, clang::Parser::LateParsedAttrList*) (/opt/compiler-explorer/clang-trunk/bin/clang+0x5b8f8d0)
#14 0x000055afe2db9fdf clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&, clang::DeclaratorContext, clang::ParsedAttributes&, clang::SourceLocation*, clang::Parser::ForRangeInit*) (/opt/compiler-explorer/clang-trunk/bin/clang+0x5bc1fdf)
#15 0x000055afe2d81d26 clang::Parser::ParseDeclOrFunctionDefInternal(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec&, clang::AccessSpecifier) (/opt/compiler-explorer/clang-trunk/bin/clang+0x5b89d26)
#16 0x000055afe2d82e8f clang::Parser::ParseDeclarationOrFunctionDefinition(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*, clang::AccessSpecifier) (.part.0) Parser.cpp:0:0
#17 0x000055afe2d8a90f clang::Parser::ParseExternalDeclaration(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*) (/opt/compiler-explorer/clang-trunk/bin/clang+0x5b9290f)
#18 0x000055afe2d8be56 clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, clang::Sema::ModuleImportState&) (/opt/compiler-explorer/clang-trunk/bin/clang+0x5b93e56)
#19 0x000055afe2d7b39a clang::ParseAST(clang::Sema&, bool, bool) (/opt/compiler-explorer/clang-trunk/bin/clang+0x5b8339a)
#20 0x000055afe19bf20d clang::CodeGenAction::ExecuteAction() (/opt/compiler-explorer/clang-trunk/bin/clang+0x47c720d)
#21 0x000055afe129ad61 clang::FrontendAction::Execute() (/opt/compiler-explorer/clang-trunk/bin/clang+0x40a2d61)
#22 0x000055afe1220193 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/opt/compiler-explorer/clang-trunk/bin/clang+0x4028193)
#23 0x000055afe137bd03 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/opt/compiler-explorer/clang-trunk/bin/clang+0x4183d03)
#24 0x000055afde09b72c cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/opt/compiler-explorer/clang-trunk/bin/clang+0xea372c)
#25 0x000055afde096def ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&) driver.cpp:0:0
#26 0x000055afe107390d 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
#27 0x000055afe07742d7 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/opt/compiler-explorer/clang-trunk/bin/clang+0x357c2d7)
#28 0x000055afe1073dac 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
#29 0x000055afe103ac9e clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const (/opt/compiler-explorer/clang-trunk/bin/clang+0x3e42c9e)
#30 0x000055afe103b66d clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&, bool) const (/opt/compiler-explorer/clang-trunk/bin/clang+0x3e4366d)
#31 0x000055afe1045d3c clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&) (/opt/compiler-explorer/clang-trunk/bin/clang+0x3e4dd3c)
#32 0x000055afde0992ef clang_main(int, char**, llvm::ToolContext const&) (/opt/compiler-explorer/clang-trunk/bin/clang+0xea12ef)
#33 0x000055afddf957b5 main (/opt/compiler-explorer/clang-trunk/bin/clang+0xd9d7b5)
#34 0x00007f9754e55083 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x24083)
#35 0x000055afde0930ce _start (/opt/compiler-explorer/clang-trunk/bin/clang+0xe9b0ce)
clang: error: clang frontend command failed with exit code 139 (use -v to see invocation)
Compiler returned: 139
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzkWt1u4ziyfhrlhrAhkfq9yIXbac_pQc8k6ARzcK4Miiw5PJFILUWlk72YZ1-QkmNRcZzecWYwiwU6HYU_xaqvvmIVKdGuEzsJcBkkn4Lk6oL25l7py-8CtFHyolT8-fLuHlDZ75DRYrcDLeQOtVrtNG0CsgrCqyBcBWk4_nN_PirBEQ1wbh8CXKAg-xRkV5POctbpehAS0iCGAnKFwgCvER8fyTggwKTVdNdQpJoWUaMawRCjrek17EVMpKFRAHsRYNsG-Va7ABeTnhcFDw--VcP__3sPElFjoGmNhcIoxFTTihqQMKjvbFuQhqymcmcegjRE34W5R6o1Qknbs7gO0aJSLcimXXSi4XYBvJ5NYpp299ANk0uo1XeketP2BtVqhyx6oEUlGHViayEfArJC98a0nfUK3gR4s2NsuVO8VLVZKr0L8OafAd4Ud-r-_8rsLnXmH3dgQNad6jWDgHwOyCobfxBorbR9GHgz2h_gTEgT4AxVWjVISAsINaKsAZnnFuyAwdnZwQ0ZCrI1OuGQfTdCQfIZ_f7770P7zdfPq9vPqOvLRhhEHTM1tEobq8oMAGHu-3LJVBPgTV0_7n8tWq3-H5gJ8EZ0XQ9dgDeISm5Vr3sOyNzD4AFUUvZgNGVgXdRqaLVi0HXA0QgQXruZtOsUE9QAR7qXqGNatGY5qHxrKHtAvG_aF7zDZRAWN0MUIap3fQPSWMVRgDeqtZqNrNILeGprpUHbNkuQhdG9fAjwphRy34YWO_6d6moRo8UOLaxPNrRtrTDHmmWHFrdosdgxtjBK1eyeChmQq5Or2cHFEi8tX5mqlV5wQXdSdUawDi0qqRYOJL95Tm_kkclZH1nrZxyzXIwsAKzXGqRBLdUdaGTUA0jLIBuWewLhIwKwFRBbCXampWbVS-bCw25jVkT5IoCcFCCki2nVS446Qw1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