[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 9 19:45:40 PDT 2024


================
@@ -249,13 +249,15 @@ class APValue {
   struct NoLValuePath {};
   struct UninitArray {};
   struct UninitStruct {};
+  struct ConstexprUnknown {};
 
   template <typename Impl> friend class clang::serialization::BasicReaderBase;
   friend class ASTImporter;
   friend class ASTNodeImporter;
 
 private:
   ValueKind Kind;
+  bool AllowConstexprUnknown = false;
----------------
shafik wrote:

Initializing a bit-field inline is a C++20 extension and so I don't think I can use it.

I set `AllowConstexprUnknown` everyplace I thought it mattered in `APValue` but I obtain different results. It means I am missing someplace where `APValue` is being initialized. I can try again and see if I can hunt down the places I missed but it left me a bit spooked that it was not obvious. 

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


More information about the cfe-commits mailing list