[clang] [StaticAnalyzer] Fix non decimal macro values in tryExpandAsInteger (PR #168632)

Balázs Benics via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 19 06:59:43 PST 2025


================
@@ -142,19 +142,25 @@ std::optional<int> tryExpandAsInteger(StringRef Macro, const Preprocessor &PP) {
   if (InvalidSpelling)
     return std::nullopt;
 
-  llvm::APInt IntValue;
+  llvm::APSInt IntValue(0, true);
----------------
steakhal wrote:

```suggestion
  llvm::APSInt IntValue(/*BitWidth=*/0, /*isUnsigned=*/true);
```

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


More information about the cfe-commits mailing list