[clang] [clang] Fix assertion failure with deleted overloaded unary operators (PR #78316)

Shafik Yaghmour via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 16 18:02:45 PST 2024


================
@@ -14310,8 +14310,8 @@ Sema::CreateOverloadedUnaryOp(SourceLocation OpLoc, UnaryOperatorKind Opc,
         PartialDiagnosticAt(OpLoc, PDiag(diag::err_ovl_deleted_oper)
                                        << UnaryOperator::getOpcodeStr(Opc)
                                        << Input->getSourceRange()),
-        *this, OCD_AllCandidates, ArgsArray, UnaryOperator::getOpcodeStr(Opc),
-        OpLoc);
+        *this, OCD_AllCandidates, ArgsArray.slice(1),
----------------
shafik wrote:

Can you explain why `ArgArray.slice(1)` fixes the problem? It is not obvious to me from looking at `NoteCandidates`

https://github.com/llvm/llvm-project/pull/78316


More information about the cfe-commits mailing list