diff --git a/clang/lib/AST/ExprConstant.cpp b/clang/lib/AST/ExprConstant.cpp index f8e8aaddbfdbd..c29a6aa42aa36 100644 --- a/clang/lib/AST/ExprConstant.cpp +++ b/clang/lib/AST/ExprConstant.cpp @@ -3481,7 +3481,7 @@ static bool evaluateVarDeclInit(EvalInfo &Info, const Expr *E, // C++23 [expr.const]p8 If we have a reference type allow unknown references // and pointers. bool AllowConstexprUnknown = - Info.getLangOpts().CPlusPlus23 && VD->getType()->isReferenceType(); + Info.getLangOpts().CPlusPlus11 && VD->getType()->isReferenceType(); APValue::LValueBase Base(VD, Frame ? Frame->Index : 0, Version); @@ -8931,7 +8931,7 @@ bool LValueExprEvaluator::VisitVarDecl(const Expr *E, const VarDecl *VD) { // C++23 [expr.const]p8 If we have a reference type allow unknown references // and pointers. bool AllowConstexprUnknown = - Info.getLangOpts().CPlusPlus23 && VD->getType()->isReferenceType(); + Info.getLangOpts().CPlusPlus11 && VD->getType()->isReferenceType(); // If we are within a lambda's call operator, check whether the 'VD' referred // to within 'E' actually represents a lambda-capture that maps to a // data-member/field within the closure object, and if so, evaluate to the