================ @@ -38,10 +38,22 @@ namespace clang { namespace dataflow { -static bool isTopLevelNamespaceWithName(const NamespaceDecl &NS, - llvm::StringRef Name) { - return NS.getDeclName().isIdentifier() && NS.getName() == Name && - NS.getParent() != nullptr && NS.getParent()->isTranslationUnit(); +template <class... NameTypes> +static bool hasNestedNamespace(const NamespaceDecl &NS, llvm::StringRef Name, ---------------- ymand wrote:
I think this function name makes the callsites harder to understand. E.g. for "absl", we're not querying for a nested namespace of "absl". Please either find a more precise name or document behavior in a comment. When I read "hasNestedNamespace", I think of a function that searches a namespace for another one nested inside. At the least, why not "isNestedNamespace", since the query is on the NamespaceDecl itself and is an exact match, so "is" seems more appropriate than "has"? https://github.com/llvm/llvm-project/pull/101450 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits