[clang] Better diagnostics when assertion fails in `consteval` (PR #130458)
Yanzuo Liu via cfe-commits
cfe-commits at lists.llvm.org
Fri May 9 20:33:22 PDT 2025
================
@@ -5975,9 +5975,15 @@ static bool CheckConstexprFunction(EvalInfo &Info, SourceLocation CallLoc,
Definition->hasAttr<MSConstexprAttr>())))
return true;
- if (Info.getLangOpts().CPlusPlus11) {
- const FunctionDecl *DiagDecl = Definition ? Definition : Declaration;
+ const FunctionDecl *DiagDecl = Definition ? Definition : Declaration;
+ if (CallLoc.isMacroID() && (DiagDecl->getName() == "__assert_rtn" ||
----------------
zwuis wrote:
Please leave a comment that how this can be improved (https://github.com/llvm/llvm-project/pull/130458#discussion_r1987629037) if you don't fully implement https://github.com/llvm/llvm-project/pull/130458#discussion_r1987629037 .
https://github.com/llvm/llvm-project/pull/130458
More information about the cfe-commits
mailing list