<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/64121>64121</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[clang][Sema] CompareOverloadCandidatesForDisplay is not a valid strict weak ordering
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
danlark1
</td>
</tr>
</table>
<pre>
When running llvm test suite in debug mode after https://reviews.llvm.org/D150264, the test clang/test/SemaCXX:overloaded-builtin-operators.cpp.test and clang/test/SemaCXX:deleted-operator.cpp.test failed with the assertion
```
__debug_utils/strict_weak_ordering_check.h:59: assertion __comp(*(__first + __a), *(__first + __b)) failed: Your comparator is not a valid strict-weak ordering
0. Program arguments: llvm/llvm-project/clang/clang -cc1 -resource-dir llvm/llvm-project/clang/staging -internal-isystem llvm/llvm-project/clang/staging/include -nostdsysteminc -fsyntax-only -fshow-overloads=best -verify -triple x86_64-linux-gnu llvm/llvm-project/clang/test/SemaCXX/overloaded-builtin-operators.cpp
1. llvm/llvm-project/clang/test/SemaCXX/overloaded-builtin-operators.cpp:239:21: current parser token ')'
2. llvm/llvm-project/clang/test/SemaCXX/overloaded-builtin-operators.cpp:225:1: parsing namespace 'PR8477'
3. llvm/llvm-project/clang/test/SemaCXX/overloaded-builtin-operators.cpp:231:15: parsing function body 'PR8477::doit'
4. llvm/llvm-project/clang/test/SemaCXX/overloaded-builtin-operators.cpp:231:15: in compound statement ('{}')
#0 0x000055cfc234694e llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (llvm/llvm-project/clang/clang+0xa94694e)
#1 0x000055cfc234703c SignalHandler(int) Signals.cpp:0:0
#2 0x00007f9220f471c0 __restore_rt (/usr/grte/v5/lib64/libpthread.so.0+0x151c0)
#3 0x00007f9220dee347 gsignal (/usr/grte/v5/lib64/libc.so.6+0x75347)
#4 0x00007f9220def797 abort (/usr/grte/v5/lib64/libc.so.6+0x76797)
#5 0x000055cfc2653877 (llvm/llvm-project/clang/clang+0xac53877)
#6 0x000055cfbe6727d3 clang::OverloadCandidateSet::CompleteCandidates(clang::Sema&, clang::OverloadCandidateDisplayKind, llvm::ArrayRef<clang::Expr*>, clang::SourceLocation, llvm::function_ref<bool (clang::OverloadCandidate&)>) (llvm/llvm-project/clang/clang+0x6c727d3)
#7 0x000055cfbe6888f0 clang::OverloadCandidateSet::NoteCandidates(std::__u::pair<clang::SourceLocation, clang::PartialDiagnostic>, clang::Sema&, clang::OverloadCandidateDisplayKind, llvm::ArrayRef<clang::Expr*>, llvm::StringRef, clang::SourceLocation, llvm::function_ref<bool (clang::OverloadCandidate&)>) (llvm/llvm-project/clang/clang+0x6c888f0)
#8 0x000055cfbe691ebb clang::Sema::CreateOverloadedBinOp(clang::SourceLocation, clang::BinaryOperatorKind, clang::UnresolvedSetImpl const&, clang::Expr*, clang::Expr*, bool, bool, clang::FunctionDecl*) (llvm/llvm-project/clang/clang+0x6c91ebb)
#9 0x000055cfbe2b20ef BuildOverloadedBinOp(clang::Sema&, clang::Scope*, clang::SourceLocation, clang::BinaryOperatorKind, clang::Expr*, clang::Expr*) SemaExpr.cpp:0:0
#10 0x000055cfbe2b1bb0 clang::Sema::BuildBinOp(clang::Scope*, clang::SourceLocation, clang::BinaryOperatorKind, clang::Expr*, clang::Expr*) (llvm/llvm-project/clang/clang+0x68b1bb0)
#11 0x000055cfbe276f8e clang::Sema::ActOnBinOp(clang::Scope*, clang::SourceLocation, clang::tok::TokenKind, clang::Expr*, clang::Expr*) (llvm/llvm-project/clang/clang+0x6876f8e)
#12 0x000055cfbdbc69fd clang::Parser::ParseRHSOfBinaryExpression(clang::ActionResult<clang::Expr*, true>, clang::prec::Level) (llvm/llvm-project/clang/clang+0x61c69fd)
#13 0x000055cfbdbc54ee clang::Parser::ParseAssignmentExpression(clang::Parser::TypeCastState) (llvm/llvm-project/clang/clang+0x61c54ee)
#14 0x000055cfbdbd2b49 clang::Parser::ParseSimpleExpressionList(llvm::SmallVectorImpl<clang::Expr*>&) (llvm/llvm-project/clang/clang+0x61d2b49)
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzMWF2P27oR_TX0CyFDor4f_OBdX-MWDbpBnLa3TwJFjmx2aVIgqd31vy9I2WvL62yyaNJeIIkkkzM858wMhyG1VmwVwALldyhfzejgdtosOFWSmsdk1mp-WPxzBwqbQSmhtljKpz12YB22g3CAhcIc2mGL95oDpp0Dg3fO9RalS0TWiKwNPAl4tnNvOddmi8h6leQxKTJE7rHbweiOSar8mP9AZL2BPb3_4w-ULvUTGKkpBx61g5BOqEj3YKjTxs5Z38-DOVX82y44SHDAX-3OZh0VEjh-Fm4XoFBrwTihFYpXKF4e_y3i45_w2TSBcTM4IS0ia-uMYK55BvrYaMPBCLVt2A7Y43yH0mVeo3R5doybhul9j0iFyBKRqmk6YazDiNzhpqGI1F6WW2NtGKuPmL3Tf-nBYO-NBlpYWKy0wxQ_USk4HoFFHhg-ARspxHOMPxu9NXSPqdkOe1DORyyEF5G1f0S90f8G5pU8CRueOGIswZEBqwfDIOLCfMfMOrr1uRMJ5cAoKiNhD9bB_sfsEFkLxeTAAUdKW8dHY6EYjjp7UI6-RFrJg__a6efolDAWpavWBzl6AiO6A46cEb0E_FIVTZFFUqjhJdqq4TswrtKJrL-XkaPGyfyn-02XJPXZRBIfKzYYA8rhnhoLBjv9CAojUoY0KUcQ5JeAIDlKlwGDX9uHVtE92J4y8AA-f6mysnzFkP4aIfz6SX4JohsUCyXmt60LIOnS7wFauFdI2a-GJFSoSz0oX4bUga8wHIq-ROUdKlfHQAU4GJE0xvFLHMdxnrOOkTQr6gxGkAG-Pdjx5bMRym0cZY9fDWWASHWeZOhzo60zQPeIFH4fEcr5LeM06_3KRuQufqF1WHqCLbnCVsYpwxuxVVT-ThWXYBCpjkuNP580icPfV0fk6KjsakLiLisTFuOmMWCdNtCYo0TrwRpE1lvjAJH1U-5xi9Y3D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