aaron.ballman added inline comments.

================
Comment at: clang-tidy/fuchsia/OverloadedOperatorCheck.cpp:18
+
+AST_MATCHER(CXXMethodDecl, hasOverloadedOperator) {
+  if (Node.isCopyAssignmentOperator() || Node.isMoveAssignmentOperator())
----------------
JonasToth wrote:
> I think `isOverloadedOperator` is a better name.
I think `isFuchsiaOverloadedOperator()` is even better because of the extra 
work done by the checker (otherwise, it might be tempting to put this into 
ASTMatchers.h).


================
Comment at: clang-tidy/fuchsia/OverloadedOperatorCheck.cpp:30
+  if (const auto *D = Result.Nodes.getNodeAs<CXXMethodDecl>("decl"))
+    diag(D->getLocStart(), "operator overloading is disallowed");
+}
----------------
I think this could be better stated as "cannot overload %0" and pass in `D` 
(which should expand to something reasonable).


================
Comment at: test/clang-tidy/fuchsia-overloaded-operator.cpp:11
+public:
+  B &operator=(B other);
+  // CHECK-MESSAGES-NOT: [[@LINE-1]]:3: warning: operator overloading is 
disallowed [fuchsia-overloaded-operator]
----------------
While this is an overloaded assignment operator, it's grating for it not to 
accept a `const B&`.


https://reviews.llvm.org/D41363



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to