summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEtienne Bergeron <etienneb@google.com>2016-05-02 18:00:29 +0000
committerEtienne Bergeron <etienneb@google.com>2016-05-02 18:00:29 +0000
commit456177b98fa3d807007ccfe671aae02691480e5a (patch)
tree77b9ffe58104e1158adf04cab301d3f4721e3fae
parent93529ed9b8a9de9e63e23d50c8304b2fbb4335fe (diff)
downloadbcm5719-llvm-456177b98fa3d807007ccfe671aae02691480e5a.tar.gz
bcm5719-llvm-456177b98fa3d807007ccfe671aae02691480e5a.zip
[clang-tidy] Cleaning namespaces to be more consistant across checkers.
Summary: The goal of the patch is to bring checkers in their appropriate namespace. This path doesn't change any behavior. Reviewers: alexfh Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D19811 llvm-svn: 268264
-rw-r--r--clang-tools-extra/clang-tidy/cert/CERTTidyModule.cpp8
-rw-r--r--clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsArrayToPointerDecayCheck.cpp2
-rw-r--r--clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsArrayToPointerDecayCheck.h4
-rw-r--r--clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsConstantArrayIndexCheck.cpp2
-rw-r--r--clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsConstantArrayIndexCheck.h2
-rw-r--r--clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsPointerArithmeticCheck.cpp2
-rw-r--r--clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsPointerArithmeticCheck.h2
-rw-r--r--clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeConstCastCheck.cpp4
-rw-r--r--clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeConstCastCheck.h4
-rw-r--r--clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeCstyleCastCheck.cpp2
-rw-r--r--clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeCstyleCastCheck.h2
-rw-r--r--clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeReinterpretCastCheck.cpp2
-rw-r--r--clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeReinterpretCastCheck.h2
-rw-r--r--clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeStaticCastDowncastCheck.cpp4
-rw-r--r--clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeStaticCastDowncastCheck.h4
-rw-r--r--clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeUnionAccessCheck.cpp2
-rw-r--r--clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeUnionAccessCheck.h2
-rw-r--r--clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeVarargCheck.cpp2
-rw-r--r--clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeVarargCheck.h2
-rw-r--r--clang-tools-extra/clang-tidy/misc/AssertSideEffectCheck.cpp6
-rw-r--r--clang-tools-extra/clang-tidy/misc/AssertSideEffectCheck.h2
-rw-r--r--clang-tools-extra/clang-tidy/misc/BoolPointerImplicitConversionCheck.cpp6
-rw-r--r--clang-tools-extra/clang-tidy/misc/IncorrectRoundings.cpp14
-rw-r--r--clang-tools-extra/clang-tidy/misc/MacroParenthesesCheck.cpp2
-rw-r--r--clang-tools-extra/clang-tidy/misc/MacroParenthesesCheck.h2
-rw-r--r--clang-tools-extra/clang-tidy/misc/MoveConstantArgumentCheck.cpp6
-rw-r--r--clang-tools-extra/clang-tidy/misc/MoveConstructorInitCheck.cpp2
-rw-r--r--clang-tools-extra/clang-tidy/misc/MoveConstructorInitCheck.h2
-rw-r--r--clang-tools-extra/clang-tidy/misc/NewDeleteOverloadsCheck.cpp10
-rw-r--r--clang-tools-extra/clang-tidy/misc/NoexceptMoveConstructorCheck.cpp2
-rw-r--r--clang-tools-extra/clang-tidy/misc/NoexceptMoveConstructorCheck.h2
-rw-r--r--clang-tools-extra/clang-tidy/misc/NonCopyableObjects.cpp5
-rw-r--r--clang-tools-extra/clang-tidy/misc/NonCopyableObjects.h2
-rw-r--r--clang-tools-extra/clang-tidy/misc/SizeofContainerCheck.cpp2
-rw-r--r--clang-tools-extra/clang-tidy/misc/SizeofContainerCheck.h2
-rw-r--r--clang-tools-extra/clang-tidy/misc/StaticAssertCheck.cpp2
-rw-r--r--clang-tools-extra/clang-tidy/misc/StaticAssertCheck.h2
-rw-r--r--clang-tools-extra/clang-tidy/misc/StringIntegerAssignmentCheck.cpp2
-rw-r--r--clang-tools-extra/clang-tidy/misc/StringIntegerAssignmentCheck.h2
-rw-r--r--clang-tools-extra/clang-tidy/misc/ThrowByValueCatchByReferenceCheck.cpp2
-rw-r--r--clang-tools-extra/clang-tidy/misc/ThrowByValueCatchByReferenceCheck.h2
-rw-r--r--clang-tools-extra/clang-tidy/misc/UndelegatedConstructor.cpp5
-rw-r--r--clang-tools-extra/clang-tidy/misc/UnusedAliasDeclsCheck.cpp2
-rw-r--r--clang-tools-extra/clang-tidy/misc/UnusedAliasDeclsCheck.h2
-rw-r--r--clang-tools-extra/clang-tidy/misc/UnusedParametersCheck.cpp3
-rw-r--r--clang-tools-extra/clang-tidy/misc/UnusedParametersCheck.h2
-rw-r--r--clang-tools-extra/clang-tidy/misc/UnusedRAIICheck.cpp6
-rw-r--r--clang-tools-extra/clang-tidy/modernize/RawStringLiteralCheck.h1
-rw-r--r--clang-tools-extra/clang-tidy/modernize/RedundantVoidArgCheck.cpp5
-rw-r--r--clang-tools-extra/clang-tidy/performance/ForRangeCopyCheck.cpp4
-rw-r--r--clang-tools-extra/clang-tidy/performance/ImplicitCastInLoopCheck.cpp5
-rw-r--r--clang-tools-extra/clang-tidy/readability/ImplicitBoolCastCheck.cpp2
-rw-r--r--clang-tools-extra/clang-tidy/readability/ImplicitBoolCastCheck.h2
-rw-r--r--clang-tools-extra/clang-tidy/readability/InconsistentDeclarationParameterNameCheck.cpp4
-rw-r--r--clang-tools-extra/clang-tidy/readability/RedundantStringCStrCheck.cpp9
-rw-r--r--clang-tools-extra/clang-tidy/readability/UniqueptrDeleteReleaseCheck.cpp2
-rw-r--r--clang-tools-extra/clang-tidy/readability/UniqueptrDeleteReleaseCheck.h2
57 files changed, 137 insertions, 52 deletions
diff --git a/clang-tools-extra/clang-tidy/cert/CERTTidyModule.cpp b/clang-tools-extra/clang-tidy/cert/CERTTidyModule.cpp
index d5e4168ca35..6ba020667b7 100644
--- a/clang-tools-extra/clang-tidy/cert/CERTTidyModule.cpp
+++ b/clang-tools-extra/clang-tidy/cert/CERTTidyModule.cpp
@@ -40,7 +40,7 @@ public:
CheckFactories.registerCheck<google::build::UnnamedNamespaceInHeaderCheck>(
"cert-dcl59-cpp");
// OOP
- CheckFactories.registerCheck<MoveConstructorInitCheck>(
+ CheckFactories.registerCheck<misc::MoveConstructorInitCheck>(
"cert-oop11-cpp");
// ERR
CheckFactories.registerCheck<SetLongJmpCheck>(
@@ -49,12 +49,12 @@ public:
"cert-err58-cpp");
CheckFactories.registerCheck<ThrownExceptionTypeCheck>(
"cert-err60-cpp");
- CheckFactories.registerCheck<ThrowByValueCatchByReferenceCheck>(
+ CheckFactories.registerCheck<misc::ThrowByValueCatchByReferenceCheck>(
"cert-err61-cpp");
// C checkers
// DCL
- CheckFactories.registerCheck<StaticAssertCheck>(
+ CheckFactories.registerCheck<misc::StaticAssertCheck>(
"cert-dcl03-c");
// ENV
CheckFactories.registerCheck<CommandProcessorCheck>(
@@ -63,7 +63,7 @@ public:
CheckFactories.registerCheck<FloatLoopCounter>(
"cert-flp30-c");
// FIO
- CheckFactories.registerCheck<NonCopyableObjectsCheck>(
+ CheckFactories.registerCheck<misc::NonCopyableObjectsCheck>(
"cert-fio38-c");
// ERR
CheckFactories.registerCheck<StrToNumCheck>(
diff --git a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsArrayToPointerDecayCheck.cpp b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsArrayToPointerDecayCheck.cpp
index 8a37b1b68fa..bfcef89e6bb 100644
--- a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsArrayToPointerDecayCheck.cpp
+++ b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsArrayToPointerDecayCheck.cpp
@@ -15,6 +15,7 @@ using namespace clang::ast_matchers;
namespace clang {
namespace tidy {
+namespace cppcoreguidelines {
AST_MATCHER_P(CXXForRangeStmt, hasRangeBeginEndStmt,
ast_matchers::internal::Matcher<DeclStmt>, InnerMatcher) {
@@ -74,5 +75,6 @@ void ProBoundsArrayToPointerDecayCheck::check(
"an explicit cast instead");
}
+} // namespace cppcoreguidelines
} // namespace tidy
} // namespace clang
diff --git a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsArrayToPointerDecayCheck.h b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsArrayToPointerDecayCheck.h
index ec6979a5069..b376e64d0d7 100644
--- a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsArrayToPointerDecayCheck.h
+++ b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsArrayToPointerDecayCheck.h
@@ -14,7 +14,8 @@
namespace clang {
namespace tidy {
-
+namespace cppcoreguidelines {
+
/// This check flags all array to pointer decays
///
/// For the user-facing documentation see:
@@ -27,6 +28,7 @@ public:
void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
};
+} // namespace cppcoreguidelines
} // namespace tidy
} // namespace clang
diff --git a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsConstantArrayIndexCheck.cpp b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsConstantArrayIndexCheck.cpp
index a8dc1d87555..30792e7777c 100644
--- a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsConstantArrayIndexCheck.cpp
+++ b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsConstantArrayIndexCheck.cpp
@@ -17,6 +17,7 @@ using namespace clang::ast_matchers;
namespace clang {
namespace tidy {
+namespace cppcoreguidelines {
ProBoundsConstantArrayIndexCheck::ProBoundsConstantArrayIndexCheck(
StringRef Name, ClangTidyContext *Context)
@@ -128,5 +129,6 @@ void ProBoundsConstantArrayIndexCheck::check(
}
}
+} // namespace cppcoreguidelines
} // namespace tidy
} // namespace clang
diff --git a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsConstantArrayIndexCheck.h b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsConstantArrayIndexCheck.h
index 1caf28cc311..b83475ca419 100644
--- a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsConstantArrayIndexCheck.h
+++ b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsConstantArrayIndexCheck.h
@@ -15,6 +15,7 @@
namespace clang {
namespace tidy {
+namespace cppcoreguidelines {
/// This checks that all array subscriptions on static arrays and std::arrays
/// have a constant index and are within bounds
@@ -34,6 +35,7 @@ public:
void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
};
+} // namespace cppcoreguidelines
} // namespace tidy
} // namespace clang
diff --git a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsPointerArithmeticCheck.cpp b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsPointerArithmeticCheck.cpp
index 9dcd7c4a370..da850931328 100644
--- a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsPointerArithmeticCheck.cpp
+++ b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsPointerArithmeticCheck.cpp
@@ -15,6 +15,7 @@ using namespace clang::ast_matchers;
namespace clang {
namespace tidy {
+namespace cppcoreguidelines {
void ProBoundsPointerArithmeticCheck::registerMatchers(MatchFinder *Finder) {
if (!getLangOpts().CPlusPlus)
@@ -53,5 +54,6 @@ ProBoundsPointerArithmeticCheck::check(const MatchFinder::MatchResult &Result) {
diag(MatchedExpr->getExprLoc(), "do not use pointer arithmetic");
}
+} // namespace cppcoreguidelines
} // namespace tidy
} // namespace clang
diff --git a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsPointerArithmeticCheck.h b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsPointerArithmeticCheck.h
index f3a3fb18cff..6f330cf1358 100644
--- a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsPointerArithmeticCheck.h
+++ b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsPointerArithmeticCheck.h
@@ -14,6 +14,7 @@
namespace clang {
namespace tidy {
+namespace cppcoreguidelines {
/// Flags all kinds of pointer arithmetic that have result of pointer type, i.e.
/// +, -, +=, -=, ++, --. In addition, the [] operator on pointers (not on arrays) is flagged.
@@ -28,6 +29,7 @@ public:
void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
};
+} // namespace cppcoreguidelines
} // namespace tidy
} // namespace clang
diff --git a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeConstCastCheck.cpp b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeConstCastCheck.cpp
index 6b32ad04a3f..5331cdacddc 100644
--- a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeConstCastCheck.cpp
+++ b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeConstCastCheck.cpp
@@ -15,7 +15,8 @@ using namespace clang::ast_matchers;
namespace clang {
namespace tidy {
-
+namespace cppcoreguidelines {
+
void ProTypeConstCastCheck::registerMatchers(MatchFinder *Finder) {
if (!getLangOpts().CPlusPlus)
return;
@@ -28,5 +29,6 @@ void ProTypeConstCastCheck::check(const MatchFinder::MatchResult &Result) {
diag(MatchedCast->getOperatorLoc(), "do not use const_cast");
}
+} // namespace cppcoreguidelines
} // namespace tidy
} // namespace clang
diff --git a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeConstCastCheck.h b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeConstCastCheck.h
index af7c5547c23..fda082e1c2b 100644
--- a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeConstCastCheck.h
+++ b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeConstCastCheck.h
@@ -14,7 +14,8 @@
namespace clang {
namespace tidy {
-
+namespace cppcoreguidelines {
+
/// This check flags all instances of const_cast
///
/// For the user-facing documentation see:
@@ -27,6 +28,7 @@ public:
void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
};
+} // namespace cppcoreguidelines
} // namespace tidy
} // namespace clang
diff --git a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeCstyleCastCheck.cpp b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeCstyleCastCheck.cpp
index 542dd854c43..4055423ebc8 100644
--- a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeCstyleCastCheck.cpp
+++ b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeCstyleCastCheck.cpp
@@ -16,6 +16,7 @@ using namespace clang::ast_matchers;
namespace clang {
namespace tidy {
+namespace cppcoreguidelines {
static bool needsConstCast(QualType SourceType, QualType DestType) {
SourceType = SourceType.getNonReferenceType();
@@ -103,5 +104,6 @@ void ProTypeCstyleCastCheck::check(const MatchFinder::MatchResult &Result) {
}
}
+} // namespace cppcoreguidelines
} // namespace tidy
} // namespace clang
diff --git a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeCstyleCastCheck.h b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeCstyleCastCheck.h
index f85be87d93b..c08b883c0ad 100644
--- a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeCstyleCastCheck.h
+++ b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeCstyleCastCheck.h
@@ -14,6 +14,7 @@
namespace clang {
namespace tidy {
+namespace cppcoreguidelines {
/// This check flags all use of C-style casts that perform a static_cast
/// downcast, const_cast, or reinterpret_cast.
@@ -28,6 +29,7 @@ public:
void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
};
+} // namespace cppcoreguidelines
} // namespace tidy
} // namespace clang
diff --git a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeReinterpretCastCheck.cpp b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeReinterpretCastCheck.cpp
index 57c4a59b8f6..e56e6388c67 100644
--- a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeReinterpretCastCheck.cpp
+++ b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeReinterpretCastCheck.cpp
@@ -15,6 +15,7 @@ using namespace clang::ast_matchers;
namespace clang {
namespace tidy {
+namespace cppcoreguidelines {
void ProTypeReinterpretCastCheck::registerMatchers(MatchFinder *Finder) {
if (!getLangOpts().CPlusPlus)
@@ -30,5 +31,6 @@ void ProTypeReinterpretCastCheck::check(
diag(MatchedCast->getOperatorLoc(), "do not use reinterpret_cast");
}
+} // namespace cppcoreguidelines
} // namespace tidy
} // namespace clang
diff --git a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeReinterpretCastCheck.h b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeReinterpretCastCheck.h
index 0ca16e54112..9610546fff3 100644
--- a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeReinterpretCastCheck.h
+++ b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeReinterpretCastCheck.h
@@ -14,6 +14,7 @@
namespace clang {
namespace tidy {
+namespace cppcoreguidelines {
/// Flags all occurrences of reinterpret_cast
///
@@ -27,6 +28,7 @@ public:
void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
};
+} // namespace cppcoreguidelines
} // namespace tidy
} // namespace clang
diff --git a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeStaticCastDowncastCheck.cpp b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeStaticCastDowncastCheck.cpp
index 0033e4ed9d3..002f8f1ed2d 100644
--- a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeStaticCastDowncastCheck.cpp
+++ b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeStaticCastDowncastCheck.cpp
@@ -15,7 +15,8 @@ using namespace clang::ast_matchers;
namespace clang {
namespace tidy {
-
+namespace cppcoreguidelines {
+
void ProTypeStaticCastDowncastCheck::registerMatchers(MatchFinder *Finder) {
if (!getLangOpts().CPlusPlus)
return;
@@ -48,5 +49,6 @@ void ProTypeStaticCastDowncastCheck::check(const MatchFinder::MatchResult &Resul
"do not use static_cast to downcast from a base to a derived class");
}
+} // namespace cppcoreguidelines
} // namespace tidy
} // namespace clang
diff --git a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeStaticCastDowncastCheck.h b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeStaticCastDowncastCheck.h
index 02de48ae957..d718feca2f8 100644
--- a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeStaticCastDowncastCheck.h
+++ b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeStaticCastDowncastCheck.h
@@ -14,7 +14,8 @@
namespace clang {
namespace tidy {
-
+namespace cppcoreguidelines {
+
/// Checks for usages of static_cast, where a base class is downcasted to a derived class.
///
/// For the user-facing documentation see:
@@ -27,6 +28,7 @@ public:
void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
};
+} // namespace cppcoreguidelines
} // namespace tidy
} // namespace clang
diff --git a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeUnionAccessCheck.cpp b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeUnionAccessCheck.cpp
index 64f51369bd3..5233ad8f4b8 100644
--- a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeUnionAccessCheck.cpp
+++ b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeUnionAccessCheck.cpp
@@ -15,6 +15,7 @@ using namespace clang::ast_matchers;
namespace clang {
namespace tidy {
+namespace cppcoreguidelines {
void ProTypeUnionAccessCheck::registerMatchers(MatchFinder *Finder) {
if (!getLangOpts().CPlusPlus)
@@ -28,6 +29,7 @@ void ProTypeUnionAccessCheck::check(const MatchFinder::MatchResult &Result) {
diag(Matched->getMemberLoc(), "do not access members of unions; use (boost::)variant instead");
}
+} // namespace cppcoreguidelines
} // namespace tidy
} // namespace clang
diff --git a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeUnionAccessCheck.h b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeUnionAccessCheck.h
index 67ce6165811..28097faae9e 100644
--- a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeUnionAccessCheck.h
+++ b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeUnionAccessCheck.h
@@ -14,6 +14,7 @@
namespace clang {
namespace tidy {
+namespace cppcoreguidelines {
/// This check flags all access to members of unions.
/// Access to a union as a whole (e.g. passing to a function) is not flagged.
@@ -28,6 +29,7 @@ public:
void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
};
+} // namespace cppcoreguidelines
} // namespace tidy
} // namespace clang
diff --git a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeVarargCheck.cpp b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeVarargCheck.cpp
index 526016eadd9..680037f9998 100644
--- a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeVarargCheck.cpp
+++ b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeVarargCheck.cpp
@@ -15,6 +15,7 @@ using namespace clang::ast_matchers;
namespace clang {
namespace tidy {
+namespace cppcoreguidelines {
const internal::VariadicDynCastAllOfMatcher<Stmt, VAArgExpr> vAArgExpr;
@@ -72,5 +73,6 @@ void ProTypeVarargCheck::check(const MatchFinder::MatchResult &Result) {
}
}
+} // namespace cppcoreguidelines
} // namespace tidy
} // namespace clang
diff --git a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeVarargCheck.h b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeVarargCheck.h
index fd1f9bfe403..558c85680b9 100644
--- a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeVarargCheck.h
+++ b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeVarargCheck.h
@@ -14,6 +14,7 @@
namespace clang {
namespace tidy {
+namespace cppcoreguidelines {
/// This check flags all calls to c-style variadic functions and all use
/// of va_arg.
@@ -28,6 +29,7 @@ public:
void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
};
+} // namespace cppcoreguidelines
} // namespace tidy
} // namespace clang
diff --git a/clang-tools-extra/clang-tidy/misc/AssertSideEffectCheck.cpp b/clang-tools-extra/clang-tidy/misc/AssertSideEffectCheck.cpp
index 8d63ec5ece0..7bfbd3bcd59 100644
--- a/clang-tools-extra/clang-tidy/misc/AssertSideEffectCheck.cpp
+++ b/clang-tools-extra/clang-tidy/misc/AssertSideEffectCheck.cpp
@@ -21,6 +21,9 @@
using namespace clang::ast_matchers;
namespace clang {
+namespace tidy {
+namespace misc {
+
namespace {
AST_MATCHER_P(Expr, hasSideEffect, bool, CheckFunctionCalls) {
@@ -66,8 +69,6 @@ AST_MATCHER_P(Expr, hasSideEffect, bool, CheckFunctionCalls) {
} // namespace
-namespace tidy {
-
AssertSideEffectCheck::AssertSideEffectCheck(StringRef Name,
ClangTidyContext *Context)
: ClangTidyCheck(Name, Context),
@@ -121,5 +122,6 @@ void AssertSideEffectCheck::check(const MatchFinder::MatchResult &Result) {
diag(Loc, "found %0() with side effect") << AssertMacroName;
}
+} // namespace misc
} // namespace tidy
} // namespace clang
diff --git a/clang-tools-extra/clang-tidy/misc/AssertSideEffectCheck.h b/clang-tools-extra/clang-tidy/misc/AssertSideEffectCheck.h
index 1ca278dcacb..2bb25e2d4a4 100644
--- a/clang-tools-extra/clang-tidy/misc/AssertSideEffectCheck.h
+++ b/clang-tools-extra/clang-tidy/misc/AssertSideEffectCheck.h
@@ -17,6 +17,7 @@
namespace clang {
namespace tidy {
+namespace misc {
/// Finds `assert()` with side effect.
///
@@ -44,6 +45,7 @@ private:
SmallVector<StringRef, 5> AssertMacros;
};
+} // namespace misc
} // namespace tidy
} // namespace clang
diff --git a/clang-tools-extra/clang-tidy/misc/BoolPointerImplicitConversionCheck.cpp b/clang-tools-extra/clang-tidy/misc/BoolPointerImplicitConversionCheck.cpp
index 603401a6920..da295be1a16 100644
--- a/clang-tools-extra/clang-tidy/misc/BoolPointerImplicitConversionCheck.cpp
+++ b/clang-tools-extra/clang-tidy/misc/BoolPointerImplicitConversionCheck.cpp
@@ -12,6 +12,9 @@
using namespace clang::ast_matchers;
namespace clang {
+namespace tidy {
+namespace misc {
+
namespace {
AST_MATCHER(CastExpr, isPointerToBoolean) {
@@ -20,9 +23,6 @@ AST_MATCHER(CastExpr, isPointerToBoolean) {
} // namespace
-namespace tidy {
-namespace misc {
-
void BoolPointerImplicitConversionCheck::registerMatchers(MatchFinder *Finder) {
// Look for ifs that have an implicit bool* to bool conversion in the
// condition. Filter negations.
diff --git a/clang-tools-extra/clang-tidy/misc/IncorrectRoundings.cpp b/clang-tools-extra/clang-tidy/misc/IncorrectRoundings.cpp
index bf0ef4fb02b..9a487b8112a 100644
--- a/clang-tools-extra/clang-tidy/misc/IncorrectRoundings.cpp
+++ b/clang-tools-extra/clang-tidy/misc/IncorrectRoundings.cpp
@@ -14,8 +14,13 @@
#include "clang/ASTMatchers/ASTMatchers.h"
#include "clang/Lex/Lexer.h"
+using namespace clang::ast_matchers;
+
namespace clang {
-namespace ast_matchers {
+namespace tidy {
+namespace misc {
+
+namespace {
AST_MATCHER(FloatingLiteral, floatHalf) {
const auto &literal = Node.getValue();
if ((&Node.getSemantics()) == &llvm::APFloat::IEEEsingle)
@@ -24,14 +29,9 @@ AST_MATCHER(FloatingLiteral, floatHalf) {
return literal.convertToDouble() == 0.5;
return false;
}
-} // namespace ast_matchers
-} // namespace clang
+} // namespace
-using namespace clang::ast_matchers;
-namespace clang {
-namespace tidy {
-namespace misc {
void IncorrectRoundings::registerMatchers(MatchFinder *MatchFinder) {
// Match a floating literal with value 0.5.
auto FloatHalf = floatLiteral(floatHalf());
diff --git a/clang-tools-extra/clang-tidy/misc/MacroParenthesesCheck.cpp b/clang-tools-extra/clang-tidy/misc/MacroParenthesesCheck.cpp
index 86e5d27fe6c..4b3e1ca688e 100644
--- a/clang-tools-extra/clang-tidy/misc/MacroParenthesesCheck.cpp
+++ b/clang-tools-extra/clang-tidy/misc/MacroParenthesesCheck.cpp
@@ -14,6 +14,7 @@
namespace clang {
namespace tidy {
+namespace misc {
namespace {
class MacroParenthesesPPCallbacks : public PPCallbacks {
@@ -198,5 +199,6 @@ void MacroParenthesesCheck::registerPPCallbacks(CompilerInstance &Compiler) {
&Compiler.getPreprocessor(), this));
}
+} // namespace misc
} // namespace tidy
} // namespace clang
diff --git a/clang-tools-extra/clang-tidy/misc/MacroParenthesesCheck.h b/clang-tools-extra/clang-tidy/misc/MacroParenthesesCheck.h
index f4a79c01bf6..e398fc6564c 100644
--- a/clang-tools-extra/clang-tidy/misc/MacroParenthesesCheck.h
+++ b/clang-tools-extra/clang-tidy/misc/MacroParenthesesCheck.h
@@ -14,6 +14,7 @@
namespace clang {
namespace tidy {
+namespace misc {
/// Finds macros that can have unexpected behaviour due to missing parentheses.
///
@@ -35,6 +36,7 @@ public:
void registerPPCallbacks(CompilerInstance &Compiler) override;
};
+} // namespace misc
} // namespace tidy
} // namespace clang
diff --git a/clang-tools-extra/clang-tidy/misc/MoveConstantArgumentCheck.cpp b/clang-tools-extra/clang-tidy/misc/MoveConstantArgumentCheck.cpp
index d8e817523b8..30330c33234 100644
--- a/clang-tools-extra/clang-tidy/misc/MoveConstantArgumentCheck.cpp
+++ b/clang-tools-extra/clang-tidy/misc/MoveConstantArgumentCheck.cpp
@@ -9,14 +9,14 @@
#include "MoveConstantArgumentCheck.h"
-#include <clang/Lex/Lexer.h>
+#include "clang/Lex/Lexer.h"
+
+using namespace clang::ast_matchers;
namespace clang {
namespace tidy {
namespace misc {
-using namespace ast_matchers;
-
void MoveConstantArgumentCheck::registerMatchers(MatchFinder *Finder) {
if (!getLangOpts().CPlusPlus)
return;
diff --git a/clang-tools-extra/clang-tidy/misc/MoveConstructorInitCheck.cpp b/clang-tools-extra/clang-tidy/misc/MoveConstructorInitCheck.cpp
index eeebcf692bc..0072c0cbf69 100644
--- a/clang-tools-extra/clang-tidy/misc/MoveConstructorInitCheck.cpp
+++ b/clang-tools-extra/clang-tidy/misc/MoveConstructorInitCheck.cpp
@@ -19,6 +19,7 @@ using namespace clang::ast_matchers;
namespace clang {
namespace tidy {
+namespace misc {
namespace {
@@ -175,5 +176,6 @@ void MoveConstructorInitCheck::storeOptions(ClangTidyOptions::OptionMap &Opts) {
Options.store(Opts, "IncludeStyle", IncludeSorter::toString(IncludeStyle));
}
+} // namespace misc
} // namespace tidy
} // namespace clang
diff --git a/clang-tools-extra/clang-tidy/misc/MoveConstructorInitCheck.h b/clang-tools-extra/clang-tidy/misc/MoveConstructorInitCheck.h
index c9bac19e02e..4544c1c0ef0 100644
--- a/clang-tools-extra/clang-tidy/misc/MoveConstructorInitCheck.h
+++ b/clang-tools-extra/clang-tidy/misc/MoveConstructorInitCheck.h
@@ -17,6 +17,7 @@
namespace clang {
namespace tidy {
+namespace misc {
/// The check flags user-defined move constructors that have a ctor-initializer
/// initializing a member or base class through a copy constructor instead of a
@@ -42,6 +43,7 @@ private:
const bool UseCERTSemantics;
};
+} // namespace misc
} // namespace tidy
} // namespace clang
diff --git a/clang-tools-extra/clang-tidy/misc/NewDeleteOverloadsCheck.cpp b/clang-tools-extra/clang-tidy/misc/NewDeleteOverloadsCheck.cpp
index 8f40dc671f1..4da50065026 100644
--- a/clang-tools-extra/clang-tidy/misc/NewDeleteOverloadsCheck.cpp
+++ b/clang-tools-extra/clang-tidy/misc/NewDeleteOverloadsCheck.cpp
@@ -14,7 +14,11 @@
using namespace clang::ast_matchers;
namespace clang {
+namespace tidy {
+namespace misc {
+
namespace {
+
AST_MATCHER(FunctionDecl, isPlacementOverload) {
bool New;
switch (Node.getOverloadedOperator()) {
@@ -57,12 +61,7 @@ AST_MATCHER(FunctionDecl, isPlacementOverload) {
return true;
}
-} // namespace
-namespace tidy {
-namespace misc {
-
-namespace {
OverloadedOperatorKind getCorrespondingOverload(const FunctionDecl *FD) {
switch (FD->getOverloadedOperator()) {
default: break;
@@ -125,6 +124,7 @@ bool hasCorrespondingOverloadInBaseClass(const CXXMethodDecl *MD,
return false;
}
+
} // anonymous namespace
void NewDeleteOverloadsCheck::registerMatchers(MatchFinder *Finder) {
diff --git a/clang-tools-extra/clang-tidy/misc/NoexceptMoveConstructorCheck.cpp b/clang-tools-extra/clang-tidy/misc/NoexceptMoveConstructorCheck.cpp
index 1a22e174924..769efe4edb8 100644
--- a/clang-tools-extra/clang-tidy/misc/NoexceptMoveConstructorCheck.cpp
+++ b/clang-tools-extra/clang-tidy/misc/NoexceptMoveConstructorCheck.cpp
@@ -15,6 +15,7 @@ using namespace clang::ast_matchers;
namespace clang {
namespace tidy {
+namespace misc {
void NoexceptMoveConstructorCheck::registerMatchers(MatchFinder *Finder) {
// Only register the matchers for C++11; the functionality currently does not
@@ -67,6 +68,7 @@ void NoexceptMoveConstructorCheck::check(
}
}
+} // namespace misc
} // namespace tidy
} // namespace clang
diff --git a/clang-tools-extra/clang-tidy/misc/NoexceptMoveConstructorCheck.h b/clang-tools-extra/clang-tidy/misc/NoexceptMoveConstructorCheck.h
index db0f297ffc3..0c976af11b5 100644
--- a/clang-tools-extra/clang-tidy/misc/NoexceptMoveConstructorCheck.h
+++ b/clang-tools-extra/clang-tidy/misc/NoexceptMoveConstructorCheck.h
@@ -14,6 +14,7 @@
namespace clang {
namespace tidy {
+namespace misc {
/// The check flags user-defined move constructors and assignment operators not
/// marked with `noexcept` or marked with `noexcept(expr)` where `expr`
@@ -30,6 +31,7 @@ public:
void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
};
+} // namespace misc
} // namespace tidy
} // namespace clang
diff --git a/clang-tools-extra/clang-tidy/misc/NonCopyableObjects.cpp b/clang-tools-extra/clang-tidy/misc/NonCopyableObjects.cpp
index 929bc0ce83e..8bc558f0495 100644
--- a/clang-tools-extra/clang-tidy/misc/NonCopyableObjects.cpp
+++ b/clang-tools-extra/clang-tidy/misc/NonCopyableObjects.cpp
@@ -15,6 +15,9 @@
using namespace clang::ast_matchers;
namespace clang {
+namespace tidy {
+namespace misc {
+
namespace {
// FIXME: it would be good to make a list that is also user-configurable so that
// users can add their own elements to the list. However, it may require some
@@ -49,7 +52,6 @@ AST_MATCHER(NamedDecl, isPOSIXType) {
}
} // namespace
-namespace tidy {
void NonCopyableObjectsCheck::registerMatchers(MatchFinder *Finder) {
// There are two ways to get into trouble with objects like FILE *:
// dereferencing the pointer type to be a non-pointer type, and declaring
@@ -91,6 +93,7 @@ void NonCopyableObjectsCheck::check(const MatchFinder::MatchResult &Result) {
<< BD;
}
+} // namespace misc
} // namespace tidy
} // namespace clang
diff --git a/clang-tools-extra/clang-tidy/misc/NonCopyableObjects.h b/clang-tools-extra/clang-tidy/misc/NonCopyableObjects.h
index c812e50037a..9805f74fa02 100644
--- a/clang-tools-extra/clang-tidy/misc/NonCopyableObjects.h
+++ b/clang-tools-extra/clang-tidy/misc/NonCopyableObjects.h
@@ -14,6 +14,7 @@
namespace clang {
namespace tidy {
+namespace misc {
/// The check flags dereferences and non-pointer declarations of objects that
/// are not meant to be passed by value, such as C FILE objects.
@@ -25,6 +26,7 @@ public:
void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
};
+} // namespace misc
} // namespace tidy
} // namespace clang
diff --git a/clang-tools-extra/clang-tidy/misc/SizeofContainerCheck.cpp b/clang-tools-extra/clang-tidy/misc/SizeofContainerCheck.cpp
index cd264268a6f..d591e46181d 100644
--- a/clang-tools-extra/clang-tidy/misc/SizeofContainerCheck.cpp
+++ b/clang-tools-extra/clang-tidy/misc/SizeofContainerCheck.cpp
@@ -15,6 +15,7 @@ using namespace clang::ast_matchers;
namespace clang {
namespace tidy {
+namespace misc {
void SizeofContainerCheck::registerMatchers(MatchFinder *Finder) {
Finder->addMatcher(
@@ -43,6 +44,7 @@ void SizeofContainerCheck::check(const MatchFinder::MatchResult &Result) {
"container; did you mean .size()?");
}
+} // namespace misc
} // namespace tidy
} // namespace clang
diff --git a/clang-tools-extra/clang-tidy/misc/SizeofContainerCheck.h b/clang-tools-extra/clang-tidy/misc/SizeofContainerCheck.h
index eae5a06320d..c17bbbd0e96 100644
--- a/clang-tools-extra/clang-tidy/misc/SizeofContainerCheck.h
+++ b/clang-tools-extra/clang-tidy/misc/SizeofContainerCheck.h
@@ -14,6 +14,7 @@
namespace clang {
namespace tidy {
+namespace misc {
/// Find usages of sizeof on expressions of STL container types. Most likely the
/// user wanted to use `.size()` instead.
@@ -28,6 +29,7 @@ public:
void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
};
+} // namespace misc
} // namespace tidy
} // namespace clang
diff --git a/clang-tools-extra/clang-tidy/misc/StaticAssertCheck.cpp b/clang-tools-extra/clang-tidy/misc/StaticAssertCheck.cpp
index c9793bc32c6..2b08cd52eb7 100644
--- a/clang-tools-extra/clang-tidy/misc/StaticAssertCheck.cpp
+++ b/clang-tools-extra/clang-tidy/misc/StaticAssertCheck.cpp
@@ -22,6 +22,7 @@ using namespace clang::ast_matchers;
namespace clang {
namespace tidy {
+namespace misc {
StaticAssertCheck::StaticAssertCheck(StringRef Name, ClangTidyContext *Context)
: ClangTidyCheck(Name, Context) {}
@@ -164,5 +165,6 @@ SourceLocation StaticAssertCheck::getLastParenLoc(const ASTContext *ASTCtx,
return Token.getLocation();
}
+} // namespace misc
} // namespace tidy
} // namespace clang
diff --git a/clang-tools-extra/clang-tidy/misc/StaticAssertCheck.h b/clang-tools-extra/clang-tidy/misc/StaticAssertCheck.h
index b3b1cb5fad9..284fdebc784 100644
--- a/clang-tools-extra/clang-tidy/misc/StaticAssertCheck.h
+++ b/clang-tools-extra/clang-tidy/misc/StaticAssertCheck.h
@@ -16,6 +16,7 @@
namespace clang {
namespace tidy {
+namespace misc {
/// Replaces `assert()` with `static_assert()` if the condition is evaluatable
/// at compile time.
@@ -33,6 +34,7 @@ private:
SourceLocation AssertLoc);
};
+} // namespace misc
} // namespace tidy
} // namespace clang
diff --git a/clang-tools-extra/clang-tidy/misc/StringIntegerAssignmentCheck.cpp b/clang-tools-extra/clang-tidy/misc/StringIntegerAssignmentCheck.cpp
index c9ed466ccc3..65af4a10b7b 100644
--- a/clang-tools-extra/clang-tidy/misc/StringIntegerAssignmentCheck.cpp
+++ b/clang-tools-extra/clang-tidy/misc/StringIntegerAssignmentCheck.cpp
@@ -16,6 +16,7 @@ using namespace clang::ast_matchers;
namespace clang {
namespace tidy {
+namespace misc {
void StringIntegerAssignmentCheck::registerMatchers(MatchFinder *Finder) {
if (!getLangOpts().CPlusPlus)
@@ -81,5 +82,6 @@ void StringIntegerAssignmentCheck::check(
}
}
+} // namespace misc
} // namespace tidy
} // namespace clang
diff --git a/clang-tools-extra/clang-tidy/misc/StringIntegerAssignmentCheck.h b/clang-tools-extra/clang-tidy/misc/StringIntegerAssignmentCheck.h
index 072b96aa08e..e977b57f915 100644
--- a/clang-tools-extra/clang-tidy/misc/StringIntegerAssignmentCheck.h
+++ b/clang-tools-extra/clang-tidy/misc/StringIntegerAssignmentCheck.h
@@ -14,6 +14,7 @@
namespace clang {
namespace tidy {
+namespace misc {
/// Finds instances where an integer is assigned to a string.
///
@@ -27,6 +28,7 @@ public:
void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
};
+} // namespace misc
} // namespace tidy
} // namespace clang
diff --git a/clang-tools-extra/clang-tidy/misc/ThrowByValueCatchByReferenceCheck.cpp b/clang-tools-extra/clang-tidy/misc/ThrowByValueCatchByReferenceCheck.cpp
index 3fbbe8ea860..5e89bd1d445 100644
--- a/clang-tools-extra/clang-tidy/misc/ThrowByValueCatchByReferenceCheck.cpp
+++ b/clang-tools-extra/clang-tidy/misc/ThrowByValueCatchByReferenceCheck.cpp
@@ -16,6 +16,7 @@ using namespace clang::ast_matchers;
namespace clang {
namespace tidy {
+namespace misc {
ThrowByValueCatchByReferenceCheck::ThrowByValueCatchByReferenceCheck(
StringRef Name, ClangTidyContext *Context)
@@ -155,5 +156,6 @@ void ThrowByValueCatchByReferenceCheck::diagnoseCatchLocations(
}
}
+} // namespace misc
} // namespace tidy
} // namespace clang
diff --git a/clang-tools-extra/clang-tidy/misc/ThrowByValueCatchByReferenceCheck.h b/clang-tools-extra/clang-tidy/misc/ThrowByValueCatchByReferenceCheck.h
index 70300318377..a2e7df73ddd 100644
--- a/clang-tools-extra/clang-tidy/misc/ThrowByValueCatchByReferenceCheck.h
+++ b/clang-tools-extra/clang-tidy/misc/ThrowByValueCatchByReferenceCheck.h
@@ -14,6 +14,7 @@
namespace clang {
namespace tidy {
+namespace misc {
///\brief checks for locations that do not throw by value
// or catch by reference.
@@ -43,6 +44,7 @@ private:
const bool CheckAnonymousTemporaries;
};
+} // namespace misc
} // namespace tidy
} // namespace clang
diff --git a/clang-tools-extra/clang-tidy/misc/UndelegatedConstructor.cpp b/clang-tools-extra/clang-tidy/misc/UndelegatedConstructor.cpp
index 90135e354da..3b6f1985e4c 100644
--- a/clang-tools-extra/clang-tidy/misc/UndelegatedConstructor.cpp
+++ b/clang-tools-extra/clang-tidy/misc/UndelegatedConstructor.cpp
@@ -14,6 +14,8 @@
using namespace clang::ast_matchers;
namespace clang {
+namespace tidy {
+namespace misc {
namespace {
AST_MATCHER_P(Stmt, ignoringTemporaryExpr,
@@ -46,9 +48,6 @@ AST_MATCHER_P(CXXRecordDecl, baseOfBoundNode, std::string, ID) {
}
} // namespace
-namespace tidy {
-namespace misc {
-
void UndelegatedConstructorCheck::registerMatchers(MatchFinder *Finder) {
// We look for calls to constructors of the same type in constructors. To do
// this we have to look through a variety of nodes that occur in the path,
diff --git a/clang-tools-extra/clang-tidy/misc/UnusedAliasDeclsCheck.cpp b/clang-tools-extra/clang-tidy/misc/UnusedAliasDeclsCheck.cpp
index d9a129690b7..fb18059b90c 100644
--- a/clang-tools-extra/clang-tidy/misc/UnusedAliasDeclsCheck.cpp
+++ b/clang-tools-extra/clang-tidy/misc/UnusedAliasDeclsCheck.cpp
@@ -16,6 +16,7 @@ using namespace clang::ast_matchers;
namespace clang {
namespace tidy {
+namespace misc {
void UnusedAliasDeclsCheck::registerMatchers(MatchFinder *Finder) {
// Only register the matchers for C++11; the functionality currently does not
@@ -58,5 +59,6 @@ void UnusedAliasDeclsCheck::onEndOfTranslationUnit() {
}
}
+} // namespace misc
} // namespace tidy
} // namespace clang
diff --git a/clang-tools-extra/clang-tidy/misc/UnusedAliasDeclsCheck.h b/clang-tools-extra/clang-tidy/misc/UnusedAliasDeclsCheck.h
index 6606b73e69e..54f66f7c144 100644
--- a/clang-tools-extra/clang-tidy/misc/UnusedAliasDeclsCheck.h
+++ b/clang-tools-extra/clang-tidy/misc/UnusedAliasDeclsCheck.h
@@ -15,6 +15,7 @@
namespace clang {
namespace tidy {
+namespace misc {
/// Finds unused namespace alias declarations.
class UnusedAliasDeclsCheck : public ClangTidyCheck {
@@ -29,6 +30,7 @@ private:
llvm::DenseMap<const NamedDecl *, CharSourceRange> FoundDecls;
};
+} // namespace misc
} // namespace tidy
} // namespace clang
diff --git a/clang-tools-extra/clang-tidy/misc/UnusedParametersCheck.cpp b/clang-tools-extra/clang-tidy/misc/UnusedParametersCheck.cpp
index b2504d4b973..6131132ba06 100644
--- a/clang-tools-extra/clang-tidy/misc/UnusedParametersCheck.cpp
+++ b/clang-tools-extra/clang-tidy/misc/UnusedParametersCheck.cpp
@@ -16,6 +16,8 @@ using namespace clang::ast_matchers;
namespace clang {
namespace tidy {
+namespace misc {
+
namespace {
bool isOverrideMethod(const FunctionDecl *Function) {
if (const auto *MD = dyn_cast<CXXMethodDecl>(Function))
@@ -120,5 +122,6 @@ void UnusedParametersCheck::check(const MatchFinder::MatchResult &Result) {
}
}
+} // namespace misc
} // namespace tidy
} // namespace clang
diff --git a/clang-tools-extra/clang-tidy/misc/UnusedParametersCheck.h b/clang-tools-extra/clang-tidy/misc/UnusedParametersCheck.h
index 595f3a71f7c..45b7f935b2c 100644
--- a/clang-tools-extra/clang-tidy/misc/UnusedParametersCheck.h
+++ b/clang-tools-extra/clang-tidy/misc/UnusedParametersCheck.h
@@ -14,6 +14,7 @@
namespace clang {
namespace tidy {
+namespace misc {
/// Finds unused parameters and fixes them, so that `-Wunused-parameter` can be
/// turned on.
@@ -30,6 +31,7 @@ private:
const FunctionDecl *Function, unsigned ParamIndex);
};
+} // namespace misc
} // namespace tidy
} // namespace clang
diff --git a/clang-tools-extra/clang-tidy/misc/UnusedRAIICheck.cpp b/clang-tools-extra/clang-tidy/misc/UnusedRAIICheck.cpp
index e62b31da027..a1fac9f7e50 100644
--- a/clang-tools-extra/clang-tidy/misc/UnusedRAIICheck.cpp
+++ b/clang-tools-extra/clang-tidy/misc/UnusedRAIICheck.cpp
@@ -14,6 +14,9 @@
using namespace clang::ast_matchers;
namespace clang {
+namespace tidy {
+namespace misc {
+
namespace {
AST_MATCHER(CXXRecordDecl, hasNonTrivialDestructor) {
// TODO: If the dtor is there but empty we don't want to warn either.
@@ -21,9 +24,6 @@ AST_MATCHER(CXXRecordDecl, hasNonTrivialDestructor) {
}
} // namespace
-namespace tidy {
-namespace misc {
-
void UnusedRAIICheck::registerMatchers(MatchFinder *Finder) {
// Only register the matchers for C++; the functionality currently does not
// provide any benefit to other languages, despite being benign.
diff --git a/clang-tools-extra/clang-tidy/modernize/RawStringLiteralCheck.h b/clang-tools-extra/clang-tidy/modernize/RawStringLiteralCheck.h
index aabd435ce64..1a1e135b3ed 100644
--- a/clang-tools-extra/clang-tidy/modernize/RawStringLiteralCheck.h
+++ b/clang-tools-extra/clang-tidy/modernize/RawStringLiteralCheck.h
@@ -11,7 +11,6 @@
#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_RAW_STRING_LITERAL_H
#include "../ClangTidy.h"
-//#include <string>
namespace clang {
namespace tidy {
diff --git a/clang-tools-extra/clang-tidy/modernize/RedundantVoidArgCheck.cpp b/clang-tools-extra/clang-tidy/modernize/RedundantVoidArgCheck.cpp
index 8c3a5c7a1c0..d81f156f954 100644
--- a/clang-tools-extra/clang-tidy/modernize/RedundantVoidArgCheck.cpp
+++ b/clang-tools-extra/clang-tidy/modernize/RedundantVoidArgCheck.cpp
@@ -14,6 +14,8 @@
using namespace clang::ast_matchers;
namespace clang {
+namespace tidy {
+namespace modernize {
namespace {
@@ -42,9 +44,6 @@ const char LambdaId[] = "lambda";
} // namespace
-namespace tidy {
-namespace modernize {
-
void RedundantVoidArgCheck::registerMatchers(MatchFinder *Finder) {
Finder->addMatcher(functionDecl(parameterCountIs(0), unless(isImplicit()),
unless(isExternC()))
diff --git a/clang-tools-extra/clang-tidy/performance/ForRangeCopyCheck.cpp b/clang-tools-extra/clang-tidy/performance/ForRangeCopyCheck.cpp
index abdcdf49e86..7fc9437328b 100644
--- a/clang-tools-extra/clang-tidy/performance/ForRangeCopyCheck.cpp
+++ b/clang-tools-extra/clang-tidy/performance/ForRangeCopyCheck.cpp
@@ -12,12 +12,12 @@
#include "../utils/FixItHintUtils.h"
#include "../utils/TypeTraits.h"
+using namespace clang::ast_matchers;
+
namespace clang {
namespace tidy {
namespace performance {
-using namespace ::clang::ast_matchers;
-
ForRangeCopyCheck::ForRangeCopyCheck(StringRef Name, ClangTidyContext *Context)
: ClangTidyCheck(Name, Context),
WarnOnAllAutoCopies(Options.get("WarnOnAllAutoCopies", 0)) {}
diff --git a/clang-tools-extra/clang-tidy/performance/ImplicitCastInLoopCheck.cpp b/clang-tools-extra/clang-tidy/performance/ImplicitCastInLoopCheck.cpp
index 04dadfbfad6..3fcfdba5033 100644
--- a/clang-tools-extra/clang-tidy/performance/ImplicitCastInLoopCheck.cpp
+++ b/clang-tools-extra/clang-tidy/performance/ImplicitCastInLoopCheck.cpp
@@ -15,10 +15,9 @@
#include "clang/ASTMatchers/ASTMatchers.h"
#include "clang/Lex/Lexer.h"
-namespace clang {
-
-using namespace ast_matchers;
+using namespace clang::ast_matchers;
+namespace clang {
namespace tidy {
namespace performance {
diff --git a/clang-tools-extra/clang-tidy/readability/ImplicitBoolCastCheck.cpp b/clang-tools-extra/clang-tidy/readability/ImplicitBoolCastCheck.cpp
index f41254509cc..f9c7b01d857 100644
--- a/clang-tools-extra/clang-tidy/readability/ImplicitBoolCastCheck.cpp
+++ b/clang-tools-extra/clang-tidy/readability/ImplicitBoolCastCheck.cpp
@@ -16,6 +16,7 @@ using namespace clang::ast_matchers;
namespace clang {
namespace tidy {
+namespace readability {
namespace {
@@ -415,5 +416,6 @@ void ImplicitBoolCastCheck::handleCastFromBool(
}
}
+} // namespace readability
} // namespace tidy
} // namespace clang
diff --git a/clang-tools-extra/clang-tidy/readability/ImplicitBoolCastCheck.h b/clang-tools-extra/clang-tidy/readability/ImplicitBoolCastCheck.h
index a33b96d5d2d..e9fa4807669 100644
--- a/clang-tools-extra/clang-tidy/readability/ImplicitBoolCastCheck.h
+++ b/clang-tools-extra/clang-tidy/readability/ImplicitBoolCastCheck.h
@@ -14,6 +14,7 @@
namespace clang {
namespace tidy {
+namespace readability {
/// \brief Checks for use of implicit bool casts in expressions.
///
@@ -41,6 +42,7 @@ private:
bool AllowConditionalPointerCasts;
};
+} // namespace readability
} // namespace tidy
} // namespace clang
diff --git a/clang-tools-extra/clang-tidy/readability/InconsistentDeclarationParameterNameCheck.cpp b/clang-tools-extra/clang-tidy/readability/InconsistentDeclarationParameterNameCheck.cpp
index 7c24d5be6f9..78438cb2047 100644
--- a/clang-tools-extra/clang-tidy/readability/InconsistentDeclarationParameterNameCheck.cpp
+++ b/clang-tools-extra/clang-tidy/readability/InconsistentDeclarationParameterNameCheck.cpp
@@ -15,12 +15,12 @@
#include <functional>
#include <sstream>
+using namespace clang::ast_matchers;
+
namespace clang {
namespace tidy {
namespace readability {
-using namespace ast_matchers;
-
namespace {
AST_MATCHER(FunctionDecl, hasOtherDeclarations) {
diff --git a/clang-tools-extra/clang-tidy/readability/RedundantStringCStrCheck.cpp b/clang-tools-extra/clang-tidy/readability/RedundantStringCStrCheck.cpp
index a158c54560a..ecd173ad964 100644
--- a/clang-tools-extra/clang-tidy/readability/RedundantStringCStrCheck.cpp
+++ b/clang-tools-extra/clang-tidy/readability/RedundantStringCStrCheck.cpp
@@ -14,9 +14,11 @@
#include "RedundantStringCStrCheck.h"
#include "clang/Lex/Lexer.h"
-namespace clang {
+using namespace clang::ast_matchers;
-using namespace ast_matchers;
+namespace clang {
+namespace tidy {
+namespace readability {
namespace {
@@ -67,9 +69,6 @@ formatDereference(const ast_matchers::MatchFinder::MatchResult &Result,
} // end namespace
-namespace tidy {
-namespace readability {
-
void RedundantStringCStrCheck::registerMatchers(
ast_matchers::MatchFinder *Finder) {
// Only register the matchers for C++; the functionality currently does not
diff --git a/clang-tools-extra/clang-tidy/readability/UniqueptrDeleteReleaseCheck.cpp b/clang-tools-extra/clang-tidy/readability/UniqueptrDeleteReleaseCheck.cpp
index 8a1ca4c16ce..175e34a52dc 100644
--- a/clang-tools-extra/clang-tidy/readability/UniqueptrDeleteReleaseCheck.cpp
+++ b/clang-tools-extra/clang-tidy/readability/UniqueptrDeleteReleaseCheck.cpp
@@ -16,6 +16,7 @@ using namespace clang::ast_matchers;
namespace clang {
namespace tidy {
+namespace readability {
void UniqueptrDeleteReleaseCheck::registerMatchers(MatchFinder *Finder) {
auto IsSusbstituted = qualType(anyOf(
@@ -64,6 +65,7 @@ void UniqueptrDeleteReleaseCheck::check(
" = nullptr");
}
+} // namespace readability
} // namespace tidy
} // namespace clang
diff --git a/clang-tools-extra/clang-tidy/readability/UniqueptrDeleteReleaseCheck.h b/clang-tools-extra/clang-tidy/readability/UniqueptrDeleteReleaseCheck.h
index ac55c7690a0..b38ee6c4d82 100644
--- a/clang-tools-extra/clang-tidy/readability/UniqueptrDeleteReleaseCheck.h
+++ b/clang-tools-extra/clang-tidy/readability/UniqueptrDeleteReleaseCheck.h
@@ -14,6 +14,7 @@
namespace clang {
namespace tidy {
+namespace readability {
/// Flag statements of the form: delete <unique_ptr expr>.release()
/// and replace them with: <unique_ptr expr> = nullptr
@@ -28,6 +29,7 @@ public:
void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
};
+} // namespace readability
} // namespace tidy
} // namespace clang
OpenPOWER on IntegriCloud