[clang] Better diagnostics when assertion fails in `consteval` (PR #130458)
JJ Marr via cfe-commits
cfe-commits at lists.llvm.org
Fri May 9 20:49:06 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" ||
----------------
jj-marr wrote:
I have no idea how to improve this, otherwise I'd do it. How would I get access to the preprocessor from here?
https://github.com/llvm/llvm-project/pull/130458
More information about the cfe-commits
mailing list