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


================
@@ -314,53 +316,69 @@ class APValue {
   DataType Data;
 
 public:
-  APValue() : Kind(None) {}
-  explicit APValue(APSInt I) : Kind(None) {
+  bool allowConstexprUnknown() const { return AllowConstexprUnknown; }
+
+  void setConstexprUnknown() { AllowConstexprUnknown = true; }
----------------
shafik wrote:

It seems unnecessary but if we think this is a sufficiently common idiom (to pass in a bool argument, give it a default value and only ever use the defaulted version of it then I can do it). 

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


More information about the cfe-commits mailing list