[PATCH] D41363: [clang-tidy] Adding Fuchsia checker for overloaded operators

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Dec 22 05:42:27 PST 2017


aaron.ballman accepted this revision.
aaron.ballman added a comment.
This revision is now accepted and ready to land.

In https://reviews.llvm.org/D41363#962727, @juliehockett wrote:

> > Are the Fuchsia library headers intended to also comply with this rule? I notice there's mention of a unique_ptr class, and I can't imagine that working without overloading more operators than just assignment. Perhaps this check should not be triggered for system headers?
>
> It would make sense for it to be run on the system headers when clang-tidy's -system-headers flag is included, otherwise not -- does that logic need to go into the checker though?


Ah, I forgot about that detail, so no, I don't think you need to make modifications here for that.

One more tiny nit with the test case, otherwise LGTM.



================
Comment at: test/clang-tidy/fuchsia-overloaded-operator.cpp:17
+
+A operator-(const A& a, const A& b);
+// CHECK-MESSAGES: [[@LINE-1]]:1: warning: cannot overload 'operator-' [fuchsia-overloaded-operator]
----------------
Missed these.


https://reviews.llvm.org/D41363





More information about the cfe-commits mailing list