[PATCH] D15506: [ASTMatchers] Allow hasName() to look through inline namespaces

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Mon Dec 14 13:35:41 PST 2015


aaron.ballman added a subscriber: aaron.ballman.

================
Comment at: lib/ASTMatchers/ASTMatchersInternal.cpp:320
@@ -323,3 +319,3 @@
 
-  if (Pattern.startswith("::"))
-    return FullName == Pattern;
+  for (bool SkipUnwritten : {false, true}) {
+    llvm::SmallString<128> NodeName = StringRef("::");
----------------
Cute, but this won't work with MSVC 2013. You'll get: error C3312: no callable 'begin' function found for type 'initializer-list'

================
Comment at: lib/ASTMatchers/ASTMatchersInternal.cpp:334
@@ +333,3 @@
+
+    if (Pattern.startswith("::")) {
+      if (FullName == Pattern) return true;
----------------
Should elide braces and format using clang-format.


http://reviews.llvm.org/D15506





More information about the cfe-commits mailing list