[clang] [Clang] Implement P2280R4 Using unknown pointers and references in constant expressions (PR #95474)
via cfe-commits
cfe-commits at lists.llvm.org
Fri Jun 14 03:43:29 PDT 2024
================
@@ -3300,6 +3308,11 @@ static bool HandleLValueComplexElement(EvalInfo &Info, const Expr *E,
static bool evaluateVarDeclInit(EvalInfo &Info, const Expr *E,
const VarDecl *VD, CallStackFrame *Frame,
unsigned Version, APValue *&Result) {
+ // P2280R4 If we have a reference type and we are in C++23 allow unknown
+ // references and pointers.
+ bool AllowConstexprUnknown =
+ Info.getLangOpts().CPlusPlus23 && VD->getType()->isReferenceType();
----------------
cor3ntin wrote:
Additionally, I would prefer references to the c++ standard wording rather than the paper
https://github.com/llvm/llvm-project/pull/95474
More information about the cfe-commits
mailing list