[clang][Interp][NFC] Compare std::optional variables directly
authorTimm Bäder <tbaeder@redhat.com>
Sun, 18 Jun 2023 07:07:31 +0000 (09:07 +0200)
committerTimm Bäder <tbaeder@redhat.com>
Tue, 27 Jun 2023 09:36:42 +0000 (11:36 +0200)
We can do that and we already checked that they aren't nullopt before.

clang/lib/AST/Interp/ByteCodeExprGen.cpp

index 8558ba0..86200f9 100644 (file)
@@ -230,7 +230,7 @@ bool ByteCodeExprGen<Emitter>::VisitBinaryOperator(const BinaryOperator *BO) {
 
   // Pointer arithmetic special case.
   if (BO->getOpcode() == BO_Add || BO->getOpcode() == BO_Sub) {
-    if (*T == PT_Ptr || (*LT == PT_Ptr && *RT == PT_Ptr))
+    if (T == PT_Ptr || (LT == PT_Ptr && RT == PT_Ptr))
       return this->VisitPointerArithBinOp(BO);
   }