Skip to content

Commit 2ce6318

Browse files
committed
rename
1 parent 6d10574 commit 2ce6318

File tree

11 files changed

+29
-29
lines changed

11 files changed

+29
-29
lines changed

clang-tools-extra/clang-tidy/bugprone/BugproneTidyModule.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
#include "CrtpConstructorAccessibilityCheck.h"
2626
#include "DanglingHandleCheck.h"
2727
#include "DerivedMethodShadowingBaseMethodCheck.h"
28-
#include "DontModifyStdNamespaceCheck.h"
2928
#include "DynamicStaticInitializersCheck.h"
3029
#include "EasilySwappableParametersCheck.h"
3130
#include "EmptyCatchCheck.h"
@@ -72,6 +71,7 @@
7271
#include "SizeofExpressionCheck.h"
7372
#include "SpuriouslyWakeUpFunctionsCheck.h"
7473
#include "StandaloneEmptyCheck.h"
74+
#include "StdNamespaceModificationCheck.h"
7575
#include "StringConstructorCheck.h"
7676
#include "StringIntegerAssignmentCheck.h"
7777
#include "StringLiteralWithEmbeddedNulCheck.h"
@@ -142,8 +142,6 @@ class BugproneModule : public ClangTidyModule {
142142
"bugprone-dangling-handle");
143143
CheckFactories.registerCheck<DerivedMethodShadowingBaseMethodCheck>(
144144
"bugprone-derived-method-shadowing-base-method");
145-
CheckFactories.registerCheck<DontModifyStdNamespaceCheck>(
146-
"bugprone-dont-modify-std-namespace");
147145
CheckFactories.registerCheck<DynamicStaticInitializersCheck>(
148146
"bugprone-dynamic-static-initializers");
149147
CheckFactories.registerCheck<EasilySwappableParametersCheck>(
@@ -234,6 +232,8 @@ class BugproneModule : public ClangTidyModule {
234232
"bugprone-spuriously-wake-up-functions");
235233
CheckFactories.registerCheck<StandaloneEmptyCheck>(
236234
"bugprone-standalone-empty");
235+
CheckFactories.registerCheck<StdNamespaceModificationCheck>(
236+
"bugprone-std-namespace-modification");
237237
CheckFactories.registerCheck<StringConstructorCheck>(
238238
"bugprone-string-constructor");
239239
CheckFactories.registerCheck<StringIntegerAssignmentCheck>(

clang-tools-extra/clang-tidy/bugprone/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ add_clang_library(clangTidyBugproneModule STATIC
2121
CrtpConstructorAccessibilityCheck.cpp
2222
DanglingHandleCheck.cpp
2323
DerivedMethodShadowingBaseMethodCheck.cpp
24-
DontModifyStdNamespaceCheck.cpp
2524
DynamicStaticInitializersCheck.cpp
2625
EasilySwappableParametersCheck.cpp
2726
EmptyCatchCheck.cpp
@@ -74,6 +73,7 @@ add_clang_library(clangTidyBugproneModule STATIC
7473
SmartPtrArrayMismatchCheck.cpp
7574
SpuriouslyWakeUpFunctionsCheck.cpp
7675
StandaloneEmptyCheck.cpp
76+
StdNamespaceModificationCheck.cpp
7777
StringConstructorCheck.cpp
7878
StringIntegerAssignmentCheck.cpp
7979
StringLiteralWithEmbeddedNulCheck.cpp

clang-tools-extra/clang-tidy/bugprone/DontModifyStdNamespaceCheck.cpp renamed to clang-tools-extra/clang-tidy/bugprone/StdNamespaceModificationCheck.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9-
#include "DontModifyStdNamespaceCheck.h"
9+
#include "StdNamespaceModificationCheck.h"
1010
#include "clang/ASTMatchers/ASTMatchFinder.h"
1111
#include "clang/ASTMatchers/ASTMatchersInternal.h"
1212

@@ -38,7 +38,7 @@ AST_POLYMORPHIC_MATCHER_P(
3838

3939
namespace clang::tidy::bugprone {
4040

41-
void DontModifyStdNamespaceCheck::registerMatchers(MatchFinder *Finder) {
41+
void StdNamespaceModificationCheck::registerMatchers(MatchFinder *Finder) {
4242
auto HasStdParent =
4343
hasDeclContext(namespaceDecl(hasAnyName("std", "posix"),
4444
unless(hasParent(namespaceDecl())))
@@ -108,7 +108,7 @@ static const NamespaceDecl *getTopLevelLexicalNamespaceDecl(const Decl *D) {
108108
return LastNS;
109109
}
110110

111-
void clang::tidy::bugprone::DontModifyStdNamespaceCheck::check(
111+
void clang::tidy::bugprone::StdNamespaceModificationCheck::check(
112112
const MatchFinder::MatchResult &Result) {
113113
const auto *D = Result.Nodes.getNodeAs<Decl>("decl");
114114
const auto *NS = Result.Nodes.getNodeAs<NamespaceDecl>("nmspc");

clang-tools-extra/clang-tidy/bugprone/DontModifyStdNamespaceCheck.h renamed to clang-tools-extra/clang-tidy/bugprone/StdNamespaceModificationCheck.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9-
#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_DONTMODIFYSTDNAMESPACECHECK_H
10-
#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_DONTMODIFYSTDNAMESPACECHECK_H
9+
#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_STDNAMESPACEMODIFICATIONCHECK_H
10+
#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_STDNAMESPACEMODIFICATIONCHECK_H
1111

1212
#include "../ClangTidyCheck.h"
1313

@@ -17,10 +17,10 @@ namespace clang::tidy::bugprone {
1717
/// This check warns for such modifications.
1818
///
1919
/// For the user-facing documentation see:
20-
/// https://clang.llvm.org/extra/clang-tidy/checks/bugprone/dont-modify-std-namespace.html
21-
class DontModifyStdNamespaceCheck : public ClangTidyCheck {
20+
/// https://clang.llvm.org/extra/clang-tidy/checks/bugprone/std-namespace-modification.html
21+
class StdNamespaceModificationCheck : public ClangTidyCheck {
2222
public:
23-
DontModifyStdNamespaceCheck(StringRef Name, ClangTidyContext *Context)
23+
StdNamespaceModificationCheck(StringRef Name, ClangTidyContext *Context)
2424
: ClangTidyCheck(Name, Context) {}
2525
bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
2626
return LangOpts.CPlusPlus;
@@ -31,4 +31,4 @@ class DontModifyStdNamespaceCheck : public ClangTidyCheck {
3131

3232
} // namespace clang::tidy::bugprone
3333

34-
#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_DONTMODIFYSTDNAMESPACECHECK_H
34+
#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_STDNAMESPACEMODIFICATIONCHECK_H

clang-tools-extra/clang-tidy/cert/CERTTidyModule.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@
1111
#include "../ClangTidyModuleRegistry.h"
1212
#include "../bugprone/BadSignalToKillThreadCheck.h"
1313
#include "../bugprone/CommandProcessorCheck.h"
14-
#include "../bugprone/DontModifyStdNamespaceCheck.h"
1514
#include "../bugprone/PointerArithmeticOnPolymorphicObjectCheck.h"
1615
#include "../bugprone/ReservedIdentifierCheck.h"
1716
#include "../bugprone/SignalHandlerCheck.h"
1817
#include "../bugprone/SignedCharMisuseCheck.h"
1918
#include "../bugprone/SizeofExpressionCheck.h"
2019
#include "../bugprone/SpuriouslyWakeUpFunctionsCheck.h"
20+
#include "../bugprone/StdNamespaceModificationCheck.h"
2121
#include "../bugprone/SuspiciousMemoryComparisonCheck.h"
2222
#include "../bugprone/ThrowingStaticInitializationCheck.h"
2323
#include "../bugprone/UncheckedStringToNumberConversionCheck.h"
@@ -251,7 +251,7 @@ class CERTModule : public ClangTidyModule {
251251
"cert-dcl51-cpp");
252252
CheckFactories.registerCheck<misc::NewDeleteOverloadsCheck>(
253253
"cert-dcl54-cpp");
254-
CheckFactories.registerCheck<bugprone::DontModifyStdNamespaceCheck>(
254+
CheckFactories.registerCheck<bugprone::StdNamespaceModificationCheck>(
255255
"cert-dcl58-cpp");
256256
CheckFactories.registerCheck<google::build::UnnamedNamespaceInHeaderCheck>(
257257
"cert-dcl59-cpp");

clang-tools-extra/docs/ReleaseNotes.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,8 +245,8 @@ New check aliases
245245
keeping initial check as an alias to the new one.
246246

247247
- Renamed :doc:`cert-dcl58-cpp <clang-tidy/checks/cert/dcl58-cpp>` to
248-
:doc:`bugprone-dont-modify-std-namespace
249-
<clang-tidy/checks/bugprone/dont-modify-std-namespace>`
248+
:doc:`bugprone-std-namespace-modification
249+
<clang-tidy/checks/bugprone/std-namespace-modification>`
250250
keeping initial check as an alias to the new one.
251251

252252
- Renamed :doc:`cert-env33-c <clang-tidy/checks/cert/env33-c>` to

clang-tools-extra/docs/clang-tidy/checks/bugprone/dont-modify-std-namespace.rst renamed to clang-tools-extra/docs/clang-tidy/checks/bugprone/std-namespace-modification.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
.. title:: clang-tidy - bugprone-dont-modify-std-namespace
1+
.. title:: clang-tidy - bugprone-std-namespace-modification
22

3-
bugprone-dont-modify-std-namespace
4-
==================================
3+
bugprone-std-namespace-modification
4+
===================================
5+
6+
Warns on modifications of the ``std`` or ``posix`` namespaces which can
7+
result in undefined behavior.
58

6-
Modification of the ``std`` or ``posix`` namespace can result in undefined
7-
behavior.
8-
This check warns for such modifications.
99
The ``std`` (or ``posix``) namespace is allowed to be extended with (class or
1010
function) template specializations that depend on an user-defined type (a type
1111
that is not defined in the standard system headers).

clang-tools-extra/docs/clang-tidy/checks/cert/dcl58-cpp.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ cert-dcl58-cpp
44
==============
55

66
The `cert-dcl58-cpp` is an aliaes, please see
7-
`bugprone-dont-modify-std-namespace <../bugprone/dont-modify-std-namespace.html>`_
7+
`bugprone-std-namespace-modification <../bugprone/std-namespace-modification.html>`_
88
for more information.
99

1010
This check corresponds to the CERT C++ Coding Standard rule

clang-tools-extra/docs/clang-tidy/checks/list.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ Clang-Tidy Checks
9393
:doc:`bugprone-crtp-constructor-accessibility <bugprone/crtp-constructor-accessibility>`, "Yes"
9494
:doc:`bugprone-dangling-handle <bugprone/dangling-handle>`,
9595
:doc:`bugprone-derived-method-shadowing-base-method <bugprone/derived-method-shadowing-base-method>`,
96-
:doc:`bugprone-dont-modify-std-namespace <bugprone/dont-modify-std-namespace>`,
9796
:doc:`bugprone-dynamic-static-initializers <bugprone/dynamic-static-initializers>`,
9897
:doc:`bugprone-easily-swappable-parameters <bugprone/easily-swappable-parameters>`,
9998
:doc:`bugprone-empty-catch <bugprone/empty-catch>`,
@@ -140,6 +139,7 @@ Clang-Tidy Checks
140139
:doc:`bugprone-sizeof-expression <bugprone/sizeof-expression>`,
141140
:doc:`bugprone-spuriously-wake-up-functions <bugprone/spuriously-wake-up-functions>`,
142141
:doc:`bugprone-standalone-empty <bugprone/standalone-empty>`, "Yes"
142+
:doc:`bugprone-std-namespace-modification <bugprone/std-namespace-modification>`,
143143
:doc:`bugprone-string-constructor <bugprone/string-constructor>`, "Yes"
144144
:doc:`bugprone-string-integer-assignment <bugprone/string-integer-assignment>`, "Yes"
145145
:doc:`bugprone-string-literal-with-embedded-nul <bugprone/string-literal-with-embedded-nul>`,
@@ -441,7 +441,7 @@ Check aliases
441441
:doc:`cert-dcl50-cpp <cert/dcl50-cpp>`, :doc:`modernize-avoid-variadic-functions <modernize/avoid-variadic-functions>`,
442442
:doc:`cert-dcl51-cpp <cert/dcl51-cpp>`, :doc:`bugprone-reserved-identifier <bugprone/reserved-identifier>`, "Yes"
443443
:doc:`cert-dcl54-cpp <cert/dcl54-cpp>`, :doc:`misc-new-delete-overloads <misc/new-delete-overloads>`,
444-
:doc:`cert-dcl58-cpp <cert/dcl58-cpp>`, :doc:`bugprone-dont-modify-std-namespace <bugprone/dont-modify-std-namespace>`,
444+
:doc:`cert-dcl58-cpp <cert/dcl58-cpp>`, :doc:`bugprone-std-namespace-modification <bugprone/std-namespace-modification>`,
445445
:doc:`cert-dcl59-cpp <cert/dcl59-cpp>`, :doc:`google-build-namespaces <google/build-namespaces>`,
446446
:doc:`cert-err09-cpp <cert/err09-cpp>`, :doc:`misc-throw-by-value-catch-by-reference <misc/throw-by-value-catch-by-reference>`,
447447
:doc:`cert-env33-c <cert/env33-c>`, :doc:`bugprone-command-processor <bugprone/command-processor>`,

clang-tools-extra/test/clang-tidy/checkers/Inputs/Headers/system-header-simulation.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ struct X {};
5959
} // namespace std
6060

6161
// Template specializations that are in a system-header file.
62-
// The purpose is to test bugprone-dont-modify-std-namespace (no warnings here).
62+
// The purpose is to test bugprone-std-namespace-modification (no warnings here).
6363
namespace std {
6464
template <>
6565
void swap<short>(short &, short &){};

0 commit comments

Comments
 (0)