summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/docs
diff options
context:
space:
mode:
authorJulie Hockett <juliehockett@google.com>2017-12-22 16:52:25 +0000
committerJulie Hockett <juliehockett@google.com>2017-12-22 16:52:25 +0000
commita966f45b7ee6a9c77a7040b51a18c01caac90918 (patch)
tree280861773da8ff8eea0be9932721fa8a663a0a8f /clang-tools-extra/docs
parent9c9b61df7e37bc1832b225c0c26123031727c8ef (diff)
downloadbcm5719-llvm-a966f45b7ee6a9c77a7040b51a18c01caac90918.tar.gz
bcm5719-llvm-a966f45b7ee6a9c77a7040b51a18c01caac90918.zip
[clang-tidy] Adding Fuchsia checker for overloaded operators
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 Revision: https://reviews.llvm.org/D41363 llvm-svn: 321363
Diffstat (limited to 'clang-tools-extra/docs')
-rw-r--r--clang-tools-extra/docs/ReleaseNotes.rst7
-rw-r--r--clang-tools-extra/docs/clang-tidy/checks/fuchsia-overloaded-operator.rst18
-rw-r--r--clang-tools-extra/docs/clang-tidy/checks/list.rst1
3 files changed, 25 insertions, 1 deletions
diff --git a/clang-tools-extra/docs/ReleaseNotes.rst b/clang-tools-extra/docs/ReleaseNotes.rst
index c438c8d6286..2a93f555324 100644
--- a/clang-tools-extra/docs/ReleaseNotes.rst
+++ b/clang-tools-extra/docs/ReleaseNotes.rst
@@ -134,7 +134,12 @@ Improvements to clang-tidy
<http://clang.llvm.org/extra/clang-tidy/checks/fuchsia-default-arguments.html>`_ check
Warns if a function or method is declared or called with default arguments.
-
+
+- New `fuchsia-overloaded-operator
+ <http://clang.llvm.org/extra/clang-tidy/checks/fuchsia-overloaded-operator.html>`_ check
+
+ Warns if an operator is overloaded, except for the assignment (copy and move) operators.
+
- New `fuchsia-virtual-inheritance
<http://clang.llvm.org/extra/clang-tidy/checks/fuchsia-virtual-inheritance.html>`_ check
diff --git a/clang-tools-extra/docs/clang-tidy/checks/fuchsia-overloaded-operator.rst b/clang-tools-extra/docs/clang-tidy/checks/fuchsia-overloaded-operator.rst
new file mode 100644
index 00000000000..070780f48db
--- /dev/null
+++ b/clang-tools-extra/docs/clang-tidy/checks/fuchsia-overloaded-operator.rst
@@ -0,0 +1,18 @@
+.. title:: clang-tidy - fuchsia-overloaded-operator
+
+fuchsia-overloaded-operator
+===========================
+
+Warns if an operator is overloaded, except for the assignment (copy and move)
+operators.
+
+For example:
+
+.. code-block:: c++
+
+ int operator+(int); // Warning
+
+ B &operator=(const B &Other); // No warning
+ B &operator=(B &&Other) // No warning
+
+See the features disallowed in Fuchsia at https://fuchsia.googlesource.com/zircon/+/master/docs/cxx.md
diff --git a/clang-tools-extra/docs/clang-tidy/checks/list.rst b/clang-tools-extra/docs/clang-tidy/checks/list.rst
index e3b0c36c676..c495f542c0a 100644
--- a/clang-tools-extra/docs/clang-tidy/checks/list.rst
+++ b/clang-tools-extra/docs/clang-tidy/checks/list.rst
@@ -69,6 +69,7 @@ Clang-Tidy Checks
cppcoreguidelines-slicing
cppcoreguidelines-special-member-functions
fuchsia-default-arguments
+ fuchsia-overloaded-operator
fuchsia-virtual-inheritance
google-build-explicit-make-pair
google-build-namespaces
OpenPOWER on IntegriCloud