Adds a check to the Fuchsia module to warn if an operator is overloaded, except move and copy operators.
See https://fuchsia.googlesource.com/zircon/+/master/docs/cxx.md for reference.
Differential D41363
[clang-tidy] Adding Fuchsia checker for overloaded operators juliehockett on Dec 18 2017, 11:08 AM. Authored by
Details Adds a check to the Fuchsia module to warn if an operator is overloaded, except move and copy operators. See https://fuchsia.googlesource.com/zircon/+/master/docs/cxx.md for reference.
Diff Detail
Event TimelineComment Actions What happens if the operator is overloaded outside a class? Is that allowed/disallowed and could you please mention the guideline on that in the docs + tests.
Comment Actions Fixing comments
Comment Actions 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?
Comment Actions
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? Comment Actions 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.
|