[PATCH] D103949: Only consider built-in compound assignment operators for -Wunused-but-set-*

Michael Benfield via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 9 09:08:58 PDT 2021


mbenfield added inline comments.


================
Comment at: clang/lib/Sema/SemaExprCXX.cpp:7794-7798
+    if (BO->getLHS()->getType()->isDependentType() ||
+        BO->getRHS()->getType()->isDependentType())
+    {
+      if (BO->getOpcode() != BO_Assign)
+        return;
----------------
Would you mind elaborating on the need for this code? IIUC, you're concerned about overloaded operators, but won't such operators always be covered by the `CXXOperatorCallExpr` case below? 


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D103949/new/

https://reviews.llvm.org/D103949



More information about the cfe-commits mailing list