[clang] [Clang] Implement P2280R4 Using unknown pointers and references in constant expressions (PR #95474)

Shafik Yaghmour via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 30 18:42:11 PDT 2024


================
@@ -1917,6 +1929,16 @@ APValue &CallStackFrame::createTemporary(const KeyT *Key, QualType T,
   return createLocal(Base, Key, T, Scope);
 }
 
+APValue &
+CallStackFrame::createConstexprUnknownAPValues(const VarDecl *Key,
+                                               APValue::LValueBase Base) {
+  APValue &Result = ConstexprUnknownAPValues[MapKeyTy(Key, Base.getVersion())];
+  Result = APValue(Base, APValue::ConstexprUnknown{}, CharUnits::One());
+  Result.setConstexprUnknown();
----------------
shafik wrote:

I might not need that anymore, there was a point where it was ambiguous with the other `APValue` constructors taking `LValueBase`.

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


More information about the cfe-commits mailing list