llvm-project/clang-tools-extra/clang-tidy/modernize
Jonas Toth d1bd01c318 [clang-tidy] Add modernize-concat-nested-namespaces check
Summary:
Finds instances of namespaces concatenated using explicit syntax, such as `namespace a { namespace b { [...] }}` and offers fix to glue it to `namespace a::b { [...] }`.

Properly handles `inline` and unnamed namespaces. ~~Also, detects empty blocks in nested namespaces and offers to remove them.~~

Test with common use cases included.
I ran the check against entire llvm repository. Except for expected `nested namespace definitions only available with -std=c++17 or -std=gnu++17` warnings I noticed no issues when the check was performed.

Example:
```
namespace a { namespace b {
void test();
}}

```
can become
```
namespace a::b {
void test();
}
```

Patch by wgml!

Reviewers: alexfh, aaron.ballman, hokein

Reviewed By: aaron.ballman

Subscribers: JonasToth, Eugene.Zelenko, lebedev.ri, mgorny, xazax.hun, cfe-commits

Tags: #clang-tools-extra

Differential Revision: https://reviews.llvm.org/D52136

llvm-svn: 343000
2018-09-25 18:12:28 +00:00
..
AvoidBindCheck.cpp Port getLocEnd -> getEndLoc 2018-08-09 22:43:02 +00:00
AvoidBindCheck.h [clang-tidy] Adds modernize-avoid-bind check 2016-05-12 20:06:04 +00:00
CMakeLists.txt [clang-tidy] Add modernize-concat-nested-namespaces check 2018-09-25 18:12:28 +00:00
ConcatNestedNamespacesCheck.cpp [clang-tidy] Add modernize-concat-nested-namespaces check 2018-09-25 18:12:28 +00:00
ConcatNestedNamespacesCheck.h [clang-tidy] Add modernize-concat-nested-namespaces check 2018-09-25 18:12:28 +00:00
DeprecatedHeadersCheck.cpp Reland "[tools] Updating PPCallbacks::InclusionDirective calls" 2018-05-10 19:13:14 +00:00
DeprecatedHeadersCheck.h [clang-tidy] Fix doxygen errors. NFC. 2016-06-17 11:43:33 +00:00
LoopConvertCheck.cpp Adapt clang-tidy checks to changing semantics of hasDeclaration. 2017-08-02 13:13:11 +00:00
LoopConvertCheck.h
LoopConvertUtils.cpp Remove trailing whitespace in docs and clang-tidy sources. 2016-12-13 16:38:45 +00:00
LoopConvertUtils.h Fix some Clang-tidy modernize-use-default and Include What You Use warnings; other minor fixes (NFC). 2016-11-29 18:24:01 +00:00
MakeSharedCheck.cpp Adapt clang-tidy checks to changing semantics of hasDeclaration. 2017-08-02 13:13:11 +00:00
MakeSharedCheck.h [clang-tidy] Add modernize-make-shared check 2016-05-02 16:56:39 +00:00
MakeSmartPtrCheck.cpp Port getLocEnd -> getEndLoc 2018-08-09 22:43:02 +00:00
MakeSmartPtrCheck.h [clang-tidy][modernize-make-unique] Checks c++14 flag before using std::make_unique 2018-03-21 14:39:24 +00:00
MakeUniqueCheck.cpp [clang-tidy][modernize-make-unique] Checks c++14 flag before using std::make_unique 2018-03-21 14:39:24 +00:00
MakeUniqueCheck.h [clang-tidy][modernize-make-unique] Checks c++14 flag before using std::make_unique 2018-03-21 14:39:24 +00:00
ModernizeTidyModule.cpp [clang-tidy] Add modernize-concat-nested-namespaces check 2018-09-25 18:12:28 +00:00
PassByValueCheck.cpp Port getLocEnd -> getEndLoc 2018-08-09 22:43:02 +00:00
PassByValueCheck.h [clang-tidy] Remove duplicated check from move-constructor-init 2016-12-17 20:23:14 +00:00
RawStringLiteralCheck.cpp Port getLocStart -> getBeginLoc 2018-08-09 22:42:26 +00:00
RawStringLiteralCheck.h [clang-tidy][modernize-raw-string-literal] Don't replace upper ASCII with raw literals 2018-05-01 18:46:32 +00:00
RedundantVoidArgCheck.cpp [Clang-Tidy: modernize] Fix for modernize-redundant-void-arg: complains about variable cast to void 2018-09-17 12:29:29 +00:00
RedundantVoidArgCheck.h Add support for type aliases to modernize-redundant-void-arg.cpp 2016-04-14 19:28:13 +00:00
ReplaceAutoPtrCheck.cpp [tidy] Move private ast matchers into anonymous namespaces to avoid ODR conflicts. 2018-02-18 19:02:35 +00:00
ReplaceAutoPtrCheck.h [clang-tidy] Cleanup namespace in utils folder. 2016-05-03 02:54:05 +00:00
ReplaceRandomShuffleCheck.cpp Port getLocStart -> getBeginLoc 2018-08-09 22:42:26 +00:00
ReplaceRandomShuffleCheck.h [clang-tidy] New check: modernize-replace-random-shuffle. 2017-04-24 09:27:20 +00:00
ReturnBracedInitListCheck.cpp [clang-tidy] Add check 'modernize-return-braced-init-list' 2017-02-15 17:06:06 +00:00
ReturnBracedInitListCheck.h [clang-tidy] Add check 'modernize-return-braced-init-list' 2017-02-15 17:06:06 +00:00
ShrinkToFitCheck.cpp Port getLocStart -> getBeginLoc 2018-08-09 22:42:26 +00:00
ShrinkToFitCheck.h
UnaryStaticAssertCheck.cpp Port getLocStart -> getBeginLoc 2018-08-09 22:42:26 +00:00
UnaryStaticAssertCheck.h [clang-tidy] Add new modernize use unary assert check 2017-07-12 13:43:35 +00:00
UseAutoCheck.cpp [clang-tidy] This patch is a fix for D45405 where spaces were mistakenly considered as a part of a type name. So length("int *") was 5 instead of 3 with RemoveStars=0 or 4 with RemoveStars=1 2018-06-15 13:35:40 +00:00
UseAutoCheck.h [clang-tidy] [modernize-use-auto] Add a threshold for minimal type name length to be replaced with 'auto' 2018-04-10 18:05:24 +00:00
UseBoolLiteralsCheck.cpp Port getLocStart -> getBeginLoc 2018-08-09 22:42:26 +00:00
UseBoolLiteralsCheck.h [clang-tidy] Add modernize-use-bool-literals.IgnoreMacros option 2017-07-17 14:43:06 +00:00
UseDefaultMemberInitCheck.cpp Port getLocStart -> getBeginLoc 2018-08-09 22:42:26 +00:00
UseDefaultMemberInitCheck.h clang-tidy: add IgnoreMacros option to modernize-use-default-member-init 2017-05-08 15:13:31 +00:00
UseEmplaceCheck.cpp Port getLocEnd -> getEndLoc 2018-08-09 22:43:02 +00:00
UseEmplaceCheck.h [clang-tidy] Add modernize-use-emplace.IgnoreImplicitConstructors option 2017-08-10 12:19:05 +00:00
UseEqualsDefaultCheck.cpp Port getLocStart -> getBeginLoc 2018-08-09 22:42:26 +00:00
UseEqualsDefaultCheck.h [clang-tidy] Add modernize-use-equals-default.IgnoreMacros option 2017-08-17 23:07:59 +00:00
UseEqualsDeleteCheck.cpp Port getLocEnd -> getEndLoc 2018-08-09 22:43:02 +00:00
UseEqualsDeleteCheck.h [clang-tidy] Add modernize-use-equals-delete check 2016-11-10 16:46:59 +00:00
UseNoexceptCheck.cpp Update to match clang r331428. 2018-05-03 03:59:50 +00:00
UseNoexceptCheck.h Wdocumentation fix. 2017-06-08 17:01:01 +00:00
UseNullptrCheck.cpp Port getLocEnd -> getEndLoc 2018-08-09 22:43:02 +00:00
UseNullptrCheck.h
UseOverrideCheck.cpp [clang-tidy] Fix modernize-use-override incorrect replacement 2017-07-07 10:15:24 +00:00
UseOverrideCheck.h
UseTransparentFunctorsCheck.cpp [modernize-use-transparent-functors] TypeLocs can be implicitly created, don't crash when encountering those. 2018-09-14 18:05:30 +00:00
UseTransparentFunctorsCheck.h [clang-tidy] New check to prefer transparent functors to non-transparent ones. 2016-11-16 14:42:10 +00:00
UseUncaughtExceptionsCheck.cpp Port getLocEnd -> getEndLoc 2018-08-09 22:43:02 +00:00
UseUncaughtExceptionsCheck.h [clang-tidy] Replace the usage of std::uncaught_exception with std::uncaught_exceptions 2018-02-20 10:48:38 +00:00
UseUsingCheck.cpp Port getLocStart -> getBeginLoc 2018-08-09 22:42:26 +00:00
UseUsingCheck.h Fixes for modernize-use-using check: 2017-04-02 19:12:20 +00:00