[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:28 PDT 2024


================
@@ -8595,7 +8643,10 @@ bool LValueExprEvaluator::VisitDeclRefExpr(const DeclRefExpr *E) {
 
 
 bool LValueExprEvaluator::VisitVarDecl(const Expr *E, const VarDecl *VD) {
-
+  // P2280R4 if we are in C++23 track if we have an unknown reference or
+  // pointer.
+  bool AllowConstexprUnknown =
+      Info.getLangOpts().CPlusPlus23 && VD->getType()->isReferenceType();
----------------
cor3ntin wrote:

Same comment as above for the DR/comment

https://github.com/llvm/llvm-project/pull/95474


More information about the cfe-commits mailing list