diff options
author | Alexander Kornienko <alexfh@google.com> | 2017-05-08 14:17:27 +0000 |
---|---|---|
committer | Alexander Kornienko <alexfh@google.com> | 2017-05-08 14:17:27 +0000 |
commit | 096977abbf448455519c38b0be3d11f58abb0b5c (patch) | |
tree | 641dd3a1e78b66e2fcc86bd46fdd1993f9b77e70 /clang-tools-extra/test/clang-tidy | |
parent | df39b03f29e310de298d0c078abb8b2bde86302b (diff) | |
download | bcm5719-llvm-096977abbf448455519c38b0be3d11f58abb0b5c.tar.gz bcm5719-llvm-096977abbf448455519c38b0be3d11f58abb0b5c.zip |
[clang-tidy] Ignore private =deleted methods in macros.
modernize-use-equals-delete is extremely noisy in code using
DISALLOW_COPY_AND_ASSIGN-style macros and there's no easy way to automatically
fix the warning when macros are in play.
llvm-svn: 302425
Diffstat (limited to 'clang-tools-extra/test/clang-tidy')
-rw-r--r-- | clang-tools-extra/test/clang-tidy/modernize-use-equals-delete.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/clang-tools-extra/test/clang-tidy/modernize-use-equals-delete.cpp b/clang-tools-extra/test/clang-tidy/modernize-use-equals-delete.cpp index 33a0f72a0b6..6ab2ae493f4 100644 --- a/clang-tools-extra/test/clang-tidy/modernize-use-equals-delete.cpp +++ b/clang-tools-extra/test/clang-tidy/modernize-use-equals-delete.cpp @@ -158,3 +158,30 @@ struct PublicDeleted { public: PublicDeleted(const PublicDeleted &) = delete; }; + +#define M1 \ + struct PrivateDeletedMacro { \ + private: \ + PrivateDeletedMacro(const PrivateDeletedMacro &) = delete; \ + }; \ + struct ProtectedDeletedMacro { \ + protected: \ + ProtectedDeletedMacro(const ProtectedDeletedMacro &) = delete; \ + } + +M1; + +#define DISALLOW_COPY_AND_ASSIGN(name) \ + name(const name &) = delete; \ + void operator=(const name &) = delete + +struct PrivateDeletedMacro2 { +private: + DISALLOW_COPY_AND_ASSIGN(PrivateDeletedMacro2); +}; + +struct ProtectedDeletedMacro2 { +protected: + DISALLOW_COPY_AND_ASSIGN(ProtectedDeletedMacro2); +}; + |