[llvm-branch-commits] [clang-tools-extra] [clang-doc][nfc] Silence tidy warning about anonymous namespace (PR #198071)
Paul Kirth via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Fri May 22 10:46:38 PDT 2026
https://github.com/ilovepi updated https://github.com/llvm/llvm-project/pull/198071
>From 440e77364a3059d0db59de816761457d03fec1a6 Mon Sep 17 00:00:00 2001
From: Paul Kirth <paulkirth at google.com>
Date: Sat, 16 May 2026 01:47:30 +0000
Subject: [PATCH] [clang-doc][nfc] Silence tidy warning about anonymous
namespace
clang-tidy complains that we should prefer static over the anonymous
namespace, despite the API being static in addition to being in the
anonymous namespace. We can silence the diagnostic by simply removing
the namespace declaration.
---
clang-tools-extra/clang-doc/Serialize.cpp | 2 --
1 file changed, 2 deletions(-)
diff --git a/clang-tools-extra/clang-doc/Serialize.cpp b/clang-tools-extra/clang-doc/Serialize.cpp
index 9ab3de5d9b49f..ed850e04fc258 100644
--- a/clang-tools-extra/clang-doc/Serialize.cpp
+++ b/clang-tools-extra/clang-doc/Serialize.cpp
@@ -26,7 +26,6 @@ namespace clang {
namespace doc {
namespace serialize {
-namespace {
static StringRef exprToString(const clang::Expr *E) {
clang::LangOptions Opts;
clang::PrintingPolicy Policy(Opts);
@@ -35,7 +34,6 @@ static StringRef exprToString(const clang::Expr *E) {
E->printPretty(OS, nullptr, Policy);
return internString(Result);
}
-} // namespace
SymbolID hashUSR(llvm::StringRef USR) {
return llvm::SHA1::hash(arrayRefFromStringRef(USR));
More information about the llvm-branch-commits
mailing list