[PATCH] D50580: [clang-tidy] Abseil: no namespace check

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Aug 12 07:09:00 PDT 2018


aaron.ballman added inline comments.


================
Comment at: clang-tidy/abseil/NoNamespaceCheck.cpp:23
+
+  Finder->addMatcher(namespaceDecl(hasName("absl")).bind("absl_namespace"),
+                     this);
----------------
I think this needs a `not(isExpansionInSystemHeader())` in there, as this is going to trigger on code that includes a header file using an `absl` namespace. If I'm incorrect and users typically include abseil as something other than system includes, you'll have to find a different way to solve this.


================
Comment at: clang-tidy/abseil/NoNamespaceCheck.cpp:32
+       "namespace 'absl' is reserved for implementation of the Abseil library "
+       "and should not be opened in the user code");
+}
----------------
in the user code -> in user code

Does Abseil prohibit the user from specializing templates in the `absl` namespace with user-defined types?


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D50580





More information about the cfe-commits mailing list