[clang] [clang][Sema] Guard diagnose_if value-dependent conditions (PR #197647)
Erich Keane via cfe-commits
cfe-commits at lists.llvm.org
Mon Jun 22 09:42:34 PDT 2026
================
@@ -7801,8 +7801,12 @@ bool Sema::diagnoseArgDependentDiagnoseIfAttrs(const FunctionDecl *Function,
// It's sane to use the same Args for any redecl of this function, since
// EvaluateWithSubstitution only cares about the position of each
// argument in the arg list, not the ParmVarDecl* it maps to.
- if (!DIA->getCond()->EvaluateWithSubstitution(
- Result, Context, cast<FunctionDecl>(DIA->getParent()), Args, ThisArg))
+ // FIXME: This doesn't consider value-dependent cases, because doing so
+ // is very difficult. Ideally, we should handle them more gracefully.
+ if (DIA->getCond()->isValueDependent() ||
----------------
erichkeane wrote:
What do you mean by `error dependency bit`? Do you mean the `RecoveryExpr` 'has error` thing? If so, I don't think that really carries any problems other than perhaps some awkward diagnostics later. We could perhaps have `hasError` checked here and ALSO return `false`, which would be completely sensible, though the result is 'we choose one of the behaviors here on error'.
https://github.com/llvm/llvm-project/pull/197647
More information about the cfe-commits
mailing list