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

    <tr>
        <th>Summary</th>
        <td>
            clang: Assertion `Diagnosed && "failed to diagnose bad conversion"' failed.
        </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 testcase (option: `clang -fopenmp-simd small.c`):
```
int *a, b;
void c(void) {
#pragma omp task depend(iterator(int *d = 23 : a), in : b)
}
```

Compiler Explorer: https://gcc.godbolt.org/z/YoMhYqKsx

Assertion message:

> ```clang: /root/llvm-project/clang/lib/Sema/SemaExprCXX.cpp:4255: clang::ExprResult clang::Sema::PerformImplicitConversion(clang::Expr*, clang::QualType, const clang::ImplicitConversionSequence&, clang::Sema::AssignmentAction, clang::Sema::CheckedConversionKind): Assertion `Diagnosed && "failed to diagnose bad conversion"' failed.```

Clang's version:
```
clang version 17.0.0 (https://github.com/llvm/llvm-project.git 12e9c7aaa66b7624b5d7666ce2794d912bf9e4b7)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /opt/compiler-explorer/clang-assertions-trunk/bin
Compiler returned: 0
```

Clang's backtrace:
```
<source>:3:43: error: incompatible integer to pointer conversion converting 'int' to type 'int *' [-Wint-conversion]
    3 | #pragma omp task depend(iterator(int *d = 23 : a), in : b)
      |                                           ^~
clang: /root/llvm-project/clang/lib/Sema/SemaExprCXX.cpp:4255: clang::ExprResult clang::Sema::PerformImplicitConversion(clang::Expr*, clang::QualType, const clang::ImplicitConversionSequence&, clang::Sema::AssignmentAction, clang::Sema::CheckedConversionKind): Assertion `Diagnosed && "failed to diagnose bad conversion"' failed.
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-assertions-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 -fopenmp-simd <source>
1.      <source>:3:50: current parser token ','
2.      <source>:2:14: parsing function body 'c'
3.      <source>:2:14: in compound statement ('{}')
 #0 0x0000558f4a42cf2f llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x3c52f2f)
 #1 0x0000558f4a42ac9c llvm::sys::CleanupOnSignal(unsigned long) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x3c50c9c)
 #2 0x0000558f4a375398 CrashRecoverySignalHandler(int) CrashRecoveryContext.cpp:0:0
 #3 0x00007f0bf2860420 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x14420)
 #4 0x00007f0bf232d00b raise (/lib/x86_64-linux-gnu/libc.so.6+0x4300b)
 #5 0x00007f0bf230c859 abort (/lib/x86_64-linux-gnu/libc.so.6+0x22859)
 #6 0x00007f0bf230c729 (/lib/x86_64-linux-gnu/libc.so.6+0x22729)
 #7 0x00007f0bf231dfd6 (/lib/x86_64-linux-gnu/libc.so.6+0x33fd6)
 #8 0x0000558f4d238255 clang::Sema::PerformImplicitConversion(clang::Expr*, clang::QualType, clang::ImplicitConversionSequence const&, clang::Sema::AssignmentAction, clang::Sema::CheckedConversionKind) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x6a5e255)
 #9 0x0000558f4d4c2953 clang::Sema::PerformImplicitConversion(clang::Expr*, clang::QualType, clang::Sema::AssignmentAction, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x6ce8953)
#10 0x0000558f4d169c6b clang::Sema::ActOnOMPIteratorExpr(clang::Scope*, clang::SourceLocation, clang::SourceLocation, clang::SourceLocation, llvm::ArrayRef<clang::Sema::OMPIteratorData>) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x698fc6b)
#11 0x0000558f4cc596b4 clang::Parser::ParseOpenMPIteratorsExpr() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x647f6b4)
#12 0x0000558f4cc5aa9d clang::Parser::ParseOpenMPVarList(llvm::omp::Directive, llvm::omp::Clause, llvm::SmallVectorImpl<clang::Expr*>&, clang::Sema::OpenMPVarListDataTy&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x6480a9d)
#13 0x0000558f4cc5b5bd clang::Parser::ParseOpenMPVarListClause(llvm::omp::Directive, llvm::omp::Clause, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x64815bd)
#14 0x0000558f4cc5ba54 clang::Parser::ParseOpenMPClause(llvm::omp::Directive, llvm::omp::Clause, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x6481a54)
#15 0x0000558f4cc68008 clang::Parser::ParseOpenMPDeclarativeOrExecutableDirective(clang::Parser::ParsedStmtContext, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x648e008)
#16 0x0000558f4cc85512 clang::Parser::ParseStatementOrDeclarationAfterAttributes(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*, clang::ParsedAttributes&, clang::ParsedAttributes&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x64ab512)
#17 0x0000558f4cc87371 clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x64ad371)
#18 0x0000558f4cc88369 clang::Parser::ParseCompoundStatementBody(bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x64ae369)
#19 0x0000558f4cc89d1a clang::Parser::ParseFunctionStatementBody(clang::Decl*, clang::Parser::ParseScope&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x64afd1a)
#20 0x0000558f4cbb4c11 clang::Parser::ParseFunctionDefinition(clang::ParsingDeclarator&, clang::Parser::ParsedTemplateInfo const&, clang::Parser::LateParsedAttrList*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x63dac11)
#21 0x0000558f4cbdbb20 clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&, clang::DeclaratorContext, clang::ParsedAttributes&, clang::SourceLocation*, clang::Parser::ForRangeInit*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x6401b20)
#22 0x0000558f4cba84b1 clang::Parser::ParseDeclOrFunctionDefInternal(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec&, clang::AccessSpecifier) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x63ce4b1)
#23 0x0000558f4cba8d6f clang::Parser::ParseDeclarationOrFunctionDefinition(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*, clang::AccessSpecifier) (.part.0) Parser.cpp:0:0
#24 0x0000558f4cbaf711 clang::Parser::ParseExternalDeclaration(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x63d5711)
#25 0x0000558f4cbb0086 clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, clang::Sema::ModuleImportState&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x63d6086)
#26 0x0000558f4cba3e2a clang::ParseAST(clang::Sema&, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x63c9e2a)
#27 0x0000558f4b6a69a8 clang::CodeGenAction::ExecuteAction() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x4ecc9a8)
#28 0x0000558f4aef0b79 clang::FrontendAction::Execute() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x4716b79)
#29 0x0000558f4ae764c6 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x469c4c6)
#30 0x0000558f4afd52a6 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x47fb2a6)
#31 0x0000558f478cf0ed cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x10f50ed)
#32 0x0000558f478cadea ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&) driver.cpp:0:0
#33 0x0000558f4acd523d 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
#34 0x0000558f4a3758a0 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x3b9b8a0)
#35 0x0000558f4acd585f 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
#36 0x0000558f4ac9c9ec clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x44c29ec)
#37 0x0000558f4ac9d47d 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+0x44c347d)
#38 0x0000558f4aca555d clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x44cb55d)
#39 0x0000558f478cd34a clang_main(int, char**, llvm::ToolContext const&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x10f334a)
#40 0x0000558f477d35c5 main (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0xff95c5)
#41 0x00007f0bf230e083 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x24083)
#42 0x0000558f478c5bce _start (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x10ebbce)
clang: error: clang frontend command failed with exit code 134 (use -v to see invocation)
Compiler returned: 134
```


</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzsW0tz47aW_jX0BiUVCfC58EIt25lOOuWetiuTrFR4HMoYUwQDgm57FvPbbwGkJIKW1O60nErVva5EIQnw8JwP33ngEdq2cl0DXAbJhyC5uqCdeVD68qsEbVR9wZR4ubx_AGSgNZy2gAKcq8ZIVQdkgYI05BWt12hWqgbqTTNr5UagdkOras6DNAxwEZBFEF4F4cLe9v-4W1kbFOAFDfASsYB86J8-KSkQD3BuLwJcoCAbWgJMGk3XG4rUpkGGto9IQAO1CHAuDWhqlLaXvViBAnKFMEFWTWrVwEska3fL7G0vM7s6qFv_u1SbRlag0fVzUykN2r78YEzTWpvwTYBv1pzP10owVZm50usA3_xfgG_-UL8-_PHnL-3zWNqibUFb4NAG2pauYQ9M_0uu0U4Nh6pDGN9opUyAb6rqaTNrtPpf4Pa274FvKskCfHMHGzr85_q50cvff5_zpgnIIsZJYuVsBQZkYTt8gbarzPipk-CuPoMuld583DSV5NIsVf0EurUjjvOJmAAvLK6jp__d0er-pQH3WNWt943XIu_gzw5qDgFOJ4L2-iwcRTdQmwV3xDvWcfkA_BHEXvov0rLDMhDt0Q_S8ErSda1aEMh9N0UBxiWVFQhkFBJDK2JUWBt21uMAZ6jvNz9MmH5MshZt3znC_d5phk4oyubhPLSeNSGXNA8dm3O1GYZ_woL5WhoUYSh4RilNU5alOGaJyNI05YCzIhZFhFlZQMyyHefvqV6DsZg85-kqjWdd_Virr_WsknX3PFvX3dDvQQMVaKMEVLZ3o1o5EPpj3RpaVSCupB5IqhpHysFjZrD1mIGoM7rFv50Z3dWPAb5hsp74mQbT6RqElRmec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