[clang-tools-extra] r298052 - [clang-tidy] Ignore deleted members in google-explicit-constructor.
Alexander Kornienko via cfe-commits
cfe-commits at lists.llvm.org
Fri Mar 17 01:40:07 PDT 2017
Author: alexfh
Date: Fri Mar 17 03:40:07 2017
New Revision: 298052
URL: http://llvm.org/viewvc/llvm-project?rev=298052&view=rev
Log:
[clang-tidy] Ignore deleted members in google-explicit-constructor.
This fixes http://llvm.org/PR32221.
Modified:
clang-tools-extra/trunk/clang-tidy/google/ExplicitConstructorCheck.cpp
clang-tools-extra/trunk/test/clang-tidy/google-explicit-constructor.cpp
Modified: clang-tools-extra/trunk/clang-tidy/google/ExplicitConstructorCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/google/ExplicitConstructorCheck.cpp?rev=298052&r1=298051&r2=298052&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/google/ExplicitConstructorCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/google/ExplicitConstructorCheck.cpp Fri Mar 17 03:40:07 2017
@@ -29,7 +29,7 @@ void ExplicitConstructorCheck::registerM
Finder->addMatcher(
cxxConversionDecl(unless(anyOf(isExplicit(), // Already marked explicit.
isImplicit(), // Compiler-generated.
- isInstantiated())))
+ isDeleted(), isInstantiated())))
.bind("conversion"),
this);
Modified: clang-tools-extra/trunk/test/clang-tidy/google-explicit-constructor.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/google-explicit-constructor.cpp?rev=298052&r1=298051&r2=298052&view=diff
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/google-explicit-constructor.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/google-explicit-constructor.cpp Fri Mar 17 03:40:07 2017
@@ -40,6 +40,8 @@ struct A {
explicit A(void *x, void *y) {}
explicit operator bool() const { return true; }
+ operator double() const = delete;
+
explicit A(const A& a) {}
// CHECK-MESSAGES: :[[@LINE-1]]:12: warning: copy constructor should not be declared explicit [google-explicit-constructor]
// CHECK-FIXES: {{^ }}A(const A& a) {}
More information about the cfe-commits
mailing list