================
@@ -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);
   constexpr unsigned AutoSenseRadix = 0;
-  if (ValueStr.getAsInteger(AutoSenseRadix, IntValue))
+  if (ValueStr.getAsInteger(AutoSenseRadix,
+                            static_cast<llvm::APInt &>(IntValue)))
----------------
steakhal wrote:

Do we need this static cast? It doesn't seem to be the case. Implicit 
conversion should just achieve this, no?

https://github.com/llvm/llvm-project/pull/168632
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to