[clang-tools-extra] [clang-doc] simplify filename selection for namespaces (PR #162885)

Paul Kirth via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 10 10:54:23 PDT 2025


================
@@ -30,6 +30,9 @@ namespace doc {
 // SHA1'd hash of a USR.
 using SymbolID = std::array<uint8_t, 20>;
 
+static const SymbolID GlobalNamespace = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
----------------
ilovepi wrote:

```suggestion
constexpr SymbolID GlobalNamespaceID = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
```
I could imagine we may want to use GlobalNamespace as a name/concept.

Alternatively we could just have a helper API `isGlobalNamespace()` that does this check w/o needing a global constant. 

Also, I don't recall what putting `static` on a constant does in a header, but its probably better if it was just  use `constexpr` instead.

https://github.com/llvm/llvm-project/pull/162885


More information about the cfe-commits mailing list