================
@@ -4110,6 +4116,10 @@ static CompleteObject findCompleteObject(EvalInfo &Info,
const Expr *E,
}
bool IsConstant = BaseType.isConstant(Info.Ctx);
+ bool ConstexprVar = false;
+ if (const auto *VD = dyn_cast_if_present<VarDecl>(
+ Info.EvaluatingDecl.dyn_cast<const ValueDecl *>()))
+ ConstexprVar = VD->isConstexpr();
----------------
Fznamznon wrote:
This is to check that an initializer for a `constexpr` variable in c23 can only
reference other `constexpr` variables. Done since C++ allows things like
```
const int a = 0;
constexpr int b = a;
```
https://github.com/llvm/llvm-project/pull/73099
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits