forked from OSchip/llvm-project
[clang-tidy] google-explicit-constructor: ignore compiler-generated conversion operators.
llvm-svn: 290668
This commit is contained in:
parent
b111409015
commit
dd0c0ba82c
|
@ -26,8 +26,11 @@ void ExplicitConstructorCheck::registerMatchers(MatchFinder *Finder) {
|
|||
return;
|
||||
Finder->addMatcher(cxxConstructorDecl(unless(isInstantiated())).bind("ctor"),
|
||||
this);
|
||||
Finder->addMatcher(cxxConversionDecl(unless(isExplicit())).bind("conversion"),
|
||||
this);
|
||||
Finder->addMatcher(
|
||||
cxxConversionDecl(unless(isExplicit()), // Already marked explicit.
|
||||
unless(isImplicit())) // Compiler-generated.
|
||||
.bind("conversion"),
|
||||
this);
|
||||
}
|
||||
|
||||
// Looks for the token matching the predicate and returns the range of the found
|
||||
|
|
|
@ -80,6 +80,10 @@ struct B {
|
|||
// CHECK-FIXES: {{^ }}B(::std::initializer_list<char> &&list6) {}
|
||||
};
|
||||
|
||||
struct StructWithFnPointer {
|
||||
void (*f)();
|
||||
} struct_with_fn_pointer = {[] {}};
|
||||
|
||||
using namespace std;
|
||||
|
||||
struct C {
|
||||
|
|
Loading…
Reference in New Issue