[PATCH] D22910: Add support for CXXOperatorCallExpr in Expr::HasSideEffects

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 29 05:35:55 PDT 2016


aaron.ballman requested changes to this revision.
This revision now requires changes to proceed.

================
Comment at: include/clang/AST/ExprCXX.h:109
@@ -108,1 +108,3 @@
 
+  // Check to see if a given overloaded operator is of assignment kind
+  static bool isAssignmentOp(OverloadedOperatorKind Opc) {
----------------
Missing the full stop at the end of the sentence.

================
Comment at: lib/AST/Expr.cpp:2869
@@ +2868,3 @@
+    OverloadedOperatorKind Op = cast<CXXOperatorCallExpr>(this)->getOperator();
+    if (CXXOperatorCallExpr::isAssignmentOp(Op)) {
+      const Decl *FD = cast<CallExpr>(this)->getCalleeDecl();
----------------
Should this also handle overloaded ++ and -- if they're the prefix forms? What about overloaded operator new and delete (and the array forms)?

================
Comment at: lib/AST/Expr.cpp:2876-2877
@@ -2864,4 +2875,4 @@
+  }
   case CallExprClass:
-  case CXXOperatorCallExprClass:
   case CXXMemberCallExprClass:
   case CUDAKernelCallExprClass:
----------------
I think this is still missing the comment about fallthrough. Please use `LLVM_FALLTHROUGH`.


https://reviews.llvm.org/D22910





More information about the cfe-commits mailing list