[PATCH] D145793: [clang][AST] Improve diagnostic for `nullptr` constexpr function pointer call
Takuya Shimizu via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Mar 10 08:27:16 PST 2023
hazohelet added inline comments.
================
Comment at: clang/lib/AST/ExprConstant.cpp:7673
+ Info.FFDiag(Callee, diag::note_constexpr_null_callee)
+ << const_cast<Expr *>(Callee);
+ return false;
----------------
tbaeder wrote:
> Is the `const_cast` really necessary?
> Is the `const_cast` really necessary?
Without `const_cast`, it did not compile.
I searched the existing codebase to find this line https://github.com/llvm/llvm-project/blob/151d3b607e1e3256ed901e02b48b92e79a77021d/clang/lib/Sema/SemaConcept.cpp#L300 and I did the same here.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D145793/new/
https://reviews.llvm.org/D145793
More information about the cfe-commits
mailing list