[PATCH] D147946: [clang-tidy] support nested inline namespace in c++20 for modernize-concat-nested-namespaces

Piotr Zegar via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 10 23:50:50 PDT 2023


PiotrZSL accepted this revision.
PiotrZSL added a comment.
This revision is now accepted and ready to land.

LGTM, just some style comments.



================
Comment at: clang-tools-extra/clang-tidy/modernize/ConcatNestedNamespacesCheck.cpp:84-86
+      Str.append(ND->getName());
+    } else
+      Str.append(ND->getName());
----------------
```
 if (ND->isInlineNamespace()) {
      Str.append("inline ");
    }
 Str.append(ND->getName());
```


================
Comment at: clang-tools-extra/clang-tidy/modernize/ConcatNestedNamespacesCheck.cpp:106
+  }
+  return ND.isAnonymousNamespace() || ND.isInlineNamespace() ||
+         !ND.attrs().empty();
----------------
You could extract ```ND.isAnonymousNamespace()``` and ```!ND.attrs().empty();``` before if.
Like
```
if (ND.isAnonymousNamespace() || !ND.attrs().empty())
  return true;
```


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D147946/new/

https://reviews.llvm.org/D147946



More information about the cfe-commits mailing list