[PATCH] D33358: [clang-tidy] readability-redundant-declaration false positive for defaulted function
Alexander Kornienko via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon May 22 06:59:09 PDT 2017
This revision was automatically updated to reflect the committed changes.
Closed by commit rL303552: [clang-tidy] readability-redundant-declaration false positive for defaulted… (authored by alexfh).
Changed prior to commit:
https://reviews.llvm.org/D33358?vs=99570&id=99757#toc
Repository:
rL LLVM
https://reviews.llvm.org/D33358
Files:
clang-tools-extra/trunk/clang-tidy/readability/RedundantDeclarationCheck.cpp
clang-tools-extra/trunk/test/clang-tidy/readability-redundant-declaration.cpp
Index: clang-tools-extra/trunk/clang-tidy/readability/RedundantDeclarationCheck.cpp
===================================================================
--- clang-tools-extra/trunk/clang-tidy/readability/RedundantDeclarationCheck.cpp
+++ clang-tools-extra/trunk/clang-tidy/readability/RedundantDeclarationCheck.cpp
@@ -19,11 +19,12 @@
namespace readability {
void RedundantDeclarationCheck::registerMatchers(MatchFinder *Finder) {
- auto UnlessDefinition = unless(isDefinition());
- Finder->addMatcher(namedDecl(anyOf(varDecl(UnlessDefinition),
- functionDecl(UnlessDefinition)))
- .bind("Decl"),
- this);
+ Finder->addMatcher(
+ namedDecl(
+ anyOf(varDecl(unless(isDefinition())),
+ functionDecl(unless(anyOf(isDefinition(), isDefaulted())))))
+ .bind("Decl"),
+ this);
}
void RedundantDeclarationCheck::check(const MatchFinder::MatchResult &Result) {
Index: clang-tools-extra/trunk/test/clang-tidy/readability-redundant-declaration.cpp
===================================================================
--- clang-tools-extra/trunk/test/clang-tidy/readability-redundant-declaration.cpp
+++ clang-tools-extra/trunk/test/clang-tidy/readability-redundant-declaration.cpp
@@ -34,3 +34,11 @@
static int I;
};
int C::I;
+
+template <class T>
+struct C2 {
+ C2();
+};
+
+template <class T>
+C2<T>::C2() = default;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D33358.99757.patch
Type: text/x-patch
Size: 1448 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170522/236c2eaf/attachment.bin>
More information about the cfe-commits
mailing list