[clang] c9637af - [Clang] Fix createConstexprUnknownAPValues to use zero offset when ceating APValue (#124478)

via cfe-commits cfe-commits at lists.llvm.org
Sun Jan 26 15:06:30 PST 2025


Author: Shafik Yaghmour
Date: 2025-01-26T15:06:26-08:00
New Revision: c9637afec7ed72904c74c2fc71e990d378f3d7a6

URL: https://github.com/llvm/llvm-project/commit/c9637afec7ed72904c74c2fc71e990d378f3d7a6
DIFF: https://github.com/llvm/llvm-project/commit/c9637afec7ed72904c74c2fc71e990d378f3d7a6.diff

LOG: [Clang] Fix createConstexprUnknownAPValues to use zero offset when ceating APValue (#124478)

When implmenting P2280R4 here:
https://github.com/llvm/llvm-project/pull/95474

When creating the APValue to store and constexprUnknown value I used an
offset of CharUnits::One() but it should have been CharUnits::Zero().

This change just adjusts that value.

Added: 
    

Modified: 
    clang/lib/AST/ExprConstant.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/AST/ExprConstant.cpp b/clang/lib/AST/ExprConstant.cpp
index 3b5ab839c6cf79..be8f1fe02e7212 100644
--- a/clang/lib/AST/ExprConstant.cpp
+++ b/clang/lib/AST/ExprConstant.cpp
@@ -1961,7 +1961,7 @@ APValue &
 CallStackFrame::createConstexprUnknownAPValues(const VarDecl *Key,
                                                APValue::LValueBase Base) {
   APValue &Result = ConstexprUnknownAPValues[MapKeyTy(Key, Base.getVersion())];
-  Result = APValue(Base, CharUnits::One(), APValue::ConstexprUnknown{});
+  Result = APValue(Base, CharUnits::Zero(), APValue::ConstexprUnknown{});
 
   return Result;
 }


        


More information about the cfe-commits mailing list