forked from OSchip/llvm-project
[clang-tidy] google-explicit-constructor: ignore macros
llvm-svn: 290756
This commit is contained in:
parent
75e39f9790
commit
2042f833fd
|
@ -89,6 +89,10 @@ void ExplicitConstructorCheck::check(const MatchFinder::MatchResult &Result) {
|
|||
if (const auto *Conversion =
|
||||
Result.Nodes.getNodeAs<CXXConversionDecl>("conversion")) {
|
||||
SourceLocation Loc = Conversion->getLocation();
|
||||
// Ignore all macros until we learn to ignore specific ones (e.g. used in
|
||||
// gmock to define matchers).
|
||||
if (Loc.isMacroID())
|
||||
return;
|
||||
diag(Loc, WarningMessage)
|
||||
<< Conversion << FixItHint::CreateInsertion(Loc, "explicit ");
|
||||
return;
|
||||
|
|
|
@ -168,5 +168,11 @@ void f2() {
|
|||
if (b) {}
|
||||
(void)(F<double>*)b;
|
||||
(void)(F<double*>*)b;
|
||||
|
||||
}
|
||||
|
||||
#define DEFINE_STRUCT_WITH_OPERATOR_BOOL(name) \
|
||||
struct name { \
|
||||
operator bool() const; \
|
||||
}
|
||||
|
||||
DEFINE_STRUCT_WITH_OPERATOR_BOOL(H);
|
||||
|
|
Loading…
Reference in New Issue