================
@@ -242,6 +242,20 @@ const PointerToMemberData *BasicValueFactory::accumCXXBase(
   return getPointerToMemberData(ND, BaseSpecList);
 }
 
+std::optional<APSIntPtr> BasicValueFactory::evalAPSInt(UnaryOperator::Opcode 
Op,
+                                                       const llvm::APSInt &V1) 
{
+  switch (Op) {
+  default:
+    llvm_unreachable("Invalid Opcode.");
----------------
steakhal wrote:

This definitely feels like a wrong choice here.
`evalAPSInt` should not invoke UB when passing non -,~ to it. It should just 
return nullopt - as the function signature would suggest, right?
btw, couldn't we also have unary `+`? Just like we have for explicit converting 
lambdas to function pointers?

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

Reply via email to