================ @@ -14527,20 +14525,24 @@ Sema::CreateOverloadedUnaryOp(SourceLocation OpLoc, UnaryOperatorKind Opc, UnaryOperator::getOpcodeStr(Opc), OpLoc); return ExprError(); - case OR_Deleted: + case OR_Deleted: { // CreateOverloadedUnaryOp fills the first element of ArgsArray with the // object whose method was called. Later in NoteCandidates size of ArgsArray // is passed further and it eventually ends up compared to number of // function candidate parameters which never includes the object parameter, // so slice ArgsArray to make sure apples are compared to apples. + StringLiteral *Msg = Best->Function->getDeletedMessage(); CandidateSet.NoteCandidates( PartialDiagnosticAt(OpLoc, PDiag(diag::err_ovl_deleted_oper) << UnaryOperator::getOpcodeStr(Opc) + << !!Msg ---------------- erichkeane wrote:
> > it is something that we don't ever do > > Weird, I recall seeing that in other places in the codebase which is the only > reason why I used it; I’d normally just write e.g. `bool(Msg)` or `Msg != > nullptr` etc. instead. Yikes! If you see it, feel free to NFC fix those :) I personally find that pattern absurdly distracting, and it isn't really necessary most of the time (other than with our operator <<'s), since pointer-to-bool conversions are well defined. The `!= nullptr` is, IMO, the 'most readable' and clear. https://github.com/llvm/llvm-project/pull/86526 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits