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

    <tr>
        <th>Summary</th>
        <td>
            [Clang] Assertion failure when assigning enum to braced-init-list with a single integer
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            clang
      </td>
    </tr>

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

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

<pre>
    This is the example from [CWG2768](https://cplusplus.github.io/CWG/issues/2768.html):

```c++
enum class E {E1};

void f() {
  E e;
  e = E{0}; // #1
  e = {0}; // #2
}
```

https://godbolt.org/z/nWo6v6W3b

```
clang++: /llvm/llvm-project/clang/lib/Sema/SemaOverload.cpp:14843: clang::ExprResult clang::Sema::CreateOverloadedBinOp(clang::SourceLocation, clang::BinaryOperatorKind, const clang::UnresolvedSetImpl &, clang::Expr *, clang::Expr *, bool, bool, clang::FunctionDecl *): Assertion `Result.isInvalid() && "C++ binary operator overloading is missing candidates!"' 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: /cmake-build-debug/bin/clang++ -cc1 -fsyntax-only test.cpp
1.      test.cpp:6:10: current parser token ';'
2.      test.cpp:3:10: parsing function body 'f'
3.      test.cpp:3:10: in compound statement ('{}')
 #0 0x00005642319db43d llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) /llvm/llvm-project/llvm/lib/Support/Unix/Signals.inc:723:11
 #1 0x00005642319db92b PrintStackTraceSignalHandler(void*) /llvm/llvm-project/llvm/lib/Support/Unix/Signals.inc:798:1
 #2 0x00005642319d9996 llvm::sys::RunSignalHandlers() /llvm/llvm-project/llvm/lib/Support/Signals.cpp:105:5
 #3 0x00005642319dc0e5 SignalHandler(int) /llvm/llvm-project/llvm/lib/Support/Unix/Signals.inc:413:1
 #4 0x00007f9d6d7d9520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
 #5 0x00007f9d6d82d9fc __pthread_kill_implementation ./nptl/pthread_kill.c:44:76
 #6 0x00007f9d6d82d9fc __pthread_kill_internal ./nptl/pthread_kill.c:78:10
 #7 0x00007f9d6d82d9fc pthread_kill ./nptl/pthread_kill.c:89:10
 #8 0x00007f9d6d7d9476 gsignal ./signal/../sysdeps/posix/raise.c:27:6
 #9 0x00007f9d6d7bf7f3 abort ./stdlib/abort.c:81:7
#10 0x00007f9d6d7bf71b _nl_load_domain ./intl/loadmsgcat.c:1177:9
#11 0x00007f9d6d7d0e96 (/lib/x86_64-linux-gnu/libc.so.6+0x39e96)
#12 0x00005642378692f9 clang::Sema::CreateOverloadedBinOp(clang::SourceLocation, clang::BinaryOperatorKind, clang::UnresolvedSetImpl const&, clang::Expr*, clang::Expr*, bool, bool, clang::FunctionDecl*) /llvm/llvm-project/clang/lib/Sema/SemaOverload.cpp:14844:42
#13 0x000056423701c0b1 BuildOverloadedBinOp(clang::Sema&, clang::Scope*, clang::SourceLocation, clang::BinaryOperatorKind, clang::Expr*, clang::Expr*) /llvm/llvm-project/clang/lib/Sema/SemaExpr.cpp:15109:12
#14 0x000056423701ba70 clang::Sema::BuildBinOp(clang::Scope*, clang::SourceLocation, clang::BinaryOperatorKind, clang::Expr*, clang::Expr*) /llvm/llvm-project/clang/lib/Sema/SemaExpr.cpp:15207:14
#15 0x0000564236fdce30 clang::Sema::ActOnBinOp(clang::Scope*, clang::SourceLocation, clang::tok::TokenKind, clang::Expr*, clang::Expr*) /llvm/llvm-project/clang/lib/Sema/SemaExpr.cpp:15059:10
#16 0x000056423650fd6f clang::Parser::ParseRHSOfBinaryExpression(clang::ActionResult<clang::Expr*, true>, clang::prec::Level) /llvm/llvm-project/clang/lib/Parse/ParseExpr.cpp:660:21
#17 0x000056423650e93f clang::Parser::ParseAssignmentExpression(clang::Parser::TypeCastState) /llvm/llvm-project/clang/lib/Parse/ParseExpr.cpp:185:10
#18 0x000056423650e7cf clang::Parser::ParseExpression(clang::Parser::TypeCastState) /llvm/llvm-project/clang/lib/Parse/ParseExpr.cpp:133:18
#19 0x00005642365ab158 clang::Parser::ParseExprStatement(clang::Parser::ParsedStmtContext) /llvm/llvm-project/clang/lib/Parse/ParseStmt.cpp:563:19
#20 0x00005642365a948a clang::Parser::ParseStatementOrDeclarationAfterAttributes(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*, clang::ParsedAttributes&, clang::ParsedAttributes&) /llvm/llvm-project/clang/lib/Parse/ParseStmt.cpp:292:14
#21 0x00005642365a8afd clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*) /llvm/llvm-project/clang/lib/Parse/ParseStmt.cpp:124:20
#22 0x00005642365b1df2 clang::Parser::ParseCompoundStatementBody(bool) /llvm/llvm-project/clang/lib/Parse/ParseStmt.cpp:1257:11
#23 0x00005642365b3507 clang::Parser::ParseFunctionStatementBody(clang::Decl*, clang::Parser::ParseScope&) /llvm/llvm-project/clang/lib/Parse/ParseStmt.cpp:2535:21
#24 0x00005642364d6840 clang::Parser::ParseFunctionDefinition(clang::ParsingDeclarator&, clang::Parser::ParsedTemplateInfo const&, clang::Parser::LateParsedAttrList*) /llvm/llvm-project/clang/lib/Parse/Parser.cpp:1525:3
#25 0x0000564236580199 clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&, clang::DeclaratorContext, clang::ParsedAttributes&, clang::Parser::ParsedTemplateInfo&, clang::SourceLocation*, clang::Parser::ForRangeInit*) /llvm/llvm-project/clang/lib/Parse/ParseDecl.cpp:2426:21
#26 0x00005642364d55fc clang::Parser::ParseDeclOrFunctionDefInternal(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec&, clang::AccessSpecifier) /llvm/llvm-project/clang/lib/Parse/Parser.cpp:1249:10
#27 0x00005642364d4ade clang::Parser::ParseDeclarationOrFunctionDefinition(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*, clang::AccessSpecifier) /llvm/llvm-project/clang/lib/Parse/Parser.cpp:1271:12
#28 0x00005642364d4369 clang::Parser::ParseExternalDeclaration(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*) /llvm/llvm-project/clang/lib/Parse/Parser.cpp:1074:14
#29 0x00005642364d218c clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, clang::Sema::ModuleImportState&) /llvm/llvm-project/clang/lib/Parse/Parser.cpp:763:12
#30 0x00005642364cccdc clang::ParseAST(clang::Sema&, bool, bool) /llvm/llvm-project/clang/lib/Parse/ParseAST.cpp:171:16
#31 0x0000564232f31bd1 clang::ASTFrontendAction::ExecuteAction() /llvm/llvm-project/clang/lib/Frontend/FrontendAction.cpp:1194:1
#32 0x0000564232f315ec clang::FrontendAction::Execute() /llvm/llvm-project/clang/lib/Frontend/FrontendAction.cpp:1082:7
#33 0x0000564232e4bc86 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) /llvm/llvm-project/clang/lib/Frontend/CompilerInstance.cpp:1061:23
#34 0x000056423310f83e clang::ExecuteCompilerInvocation(clang::CompilerInstance*) /llvm/llvm-project/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp:280:8
#35 0x000056422faeace9 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) /llvm/llvm-project/clang/tools/driver/cc1_main.cpp:285:13
#36 0x000056422fadd632 ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&) /llvm/llvm-project/clang/tools/driver/driver.cpp:215:5
#37 0x000056422fadc39b clang_main(int, char**, llvm::ToolContext const&) /llvm/llvm-project/clang/tools/driver/driver.cpp:256:5
#38 0x000056422fb11a95 main /cmake-build-debug/tools/clang/tools/driver/clang-driver.cpp:17:3
#39 0x00007f9d6d7c0d90 __libc_start_call_main ./csu/../sysdeps/nptl/libc_start_call_main.h:58:16
#40 0x00007f9d6d7c0e40 call_init ./csu/../csu/libc-start.c:128:20
#41 0x00007f9d6d7c0e40 __libc_start_main ./csu/../csu/libc-start.c:379:5
#42 0x000056422fadbe25 _start (/cmake-build-debug/bin/clang+++0x5c00e25)
```

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzUWl1z4ygW_TXkhYpLAn0-5MFx4pnU9lS62pntRxcCZLORQQsok-yv3wJJtqS2naST6tmtSrdlDJdzDpfLBUSMERvJ-RWIr0F8c0Eau1X66g9hSTU3W_V4USj2cvWwFQYKA-2WQ_5MdnXFYanVDoL4evH9N5QmGYhvAMq21tYG4DlAS4CWtK4a4_7NNsJum2ImFEDLxfffAFoKYxpuAFq6xrOt3VUA5a5lcAOC_v8kaP8oQNfuz5dy2ewgrYgx8BaC9Po2BOkNwNfDlk9KMFgClAGUuzptKYS3kO9rQsghwDfwFqTXQWsCtrghQDgcVzpaB3VdpjcTvEMoY0k2ihWqsjOlNwAt_wPQUn5XyVPyHRdHmbdfaUXkptMAzx2CqnradR-XtVb_4tQ6wdt6y0oUAC1XfEe6j_snritF2IzWNcDzMMoi7Cy1DfAc4Pntc62_cdNUdljqbfinhebE8t4QZ9dC3tcAZcPKqtGUf1GUWKEkQIuhpWshiX65r7kmVul_CMl8BSXNqMM_peZGVU-crbi929UVBCiZmHJQIUDzM8WFUtXwc1Bt2Ujq8N1wWrXVnd_BuTFcu3IIkqAVYibMnXwilWC9JzkoCQQILdrRgIVnBVVHC6pOHyE3bsLshDHukRLJBCPWeXwIEAIohSURFWezdoS_frmdr26haYqdsJDAotlAzWulLbQKTnyonUxU7U46wn52QSIZFJJWDeN--lJNzBYWhD5aTSh32tSa11pRbgxn0PgxdMWuJTFGUUEsZ1A3EhqqRW07yCtL6CNkza7eT9tgBoL8q1YbTXaQ6E2z49KazmXpjjzyy6IRFbtkvGicoxZCHtzWC3pJaQgvS_MiLXm-VLJ6gZYb6x3X9xG6PvZFeJ44fw68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