diff options
| -rw-r--r-- | clang/include/clang/ASTMatchers/ASTMatchers.h | 4 | ||||
| -rw-r--r-- | clang/lib/ASTMatchers/ASTMatchersInternal.cpp | 6 |
2 files changed, 6 insertions, 4 deletions
diff --git a/clang/include/clang/ASTMatchers/ASTMatchers.h b/clang/include/clang/ASTMatchers/ASTMatchers.h index 29cce667e1b..21a49691cd7 100644 --- a/clang/include/clang/ASTMatchers/ASTMatchers.h +++ b/clang/include/clang/ASTMatchers/ASTMatchers.h @@ -1845,7 +1845,9 @@ inline internal::Matcher<Stmt> sizeOfExpr( /// namespace a { namespace b { class X; } } /// \endcode inline internal::Matcher<NamedDecl> hasName(const std::string &Name) { - return internal::Matcher<NamedDecl>(new internal::HasNameMatcher({Name})); + std::vector<std::string> Names; + Names.push_back(Name); + return internal::Matcher<NamedDecl>(new internal::HasNameMatcher(Names)); } /// \brief Matches NamedDecl nodes that have any of the specified names. diff --git a/clang/lib/ASTMatchers/ASTMatchersInternal.cpp b/clang/lib/ASTMatchers/ASTMatchersInternal.cpp index ad785b5d61c..ed48d7718a2 100644 --- a/clang/lib/ASTMatchers/ASTMatchersInternal.cpp +++ b/clang/lib/ASTMatchers/ASTMatchersInternal.cpp @@ -369,7 +369,7 @@ public: /// Return true if there are still any patterns left. bool consumeNameSuffix(StringRef NodeName, bool CanSkip) { for (size_t I = 0; I < Patterns.size();) { - if (internal::consumeNameSuffix(Patterns[I].Pattern, NodeName) || + if (internal::consumeNameSuffix(Patterns[I].P, NodeName) || CanSkip) { ++I; } else { @@ -384,14 +384,14 @@ public: /// 'fully qualified' requirement. bool foundMatch(bool AllowFullyQualified) const { for (auto& P: Patterns) - if (P.Pattern.empty() && (AllowFullyQualified || !P.IsFullyQualified)) + if (P.P.empty() && (AllowFullyQualified || !P.IsFullyQualified)) return true; return false; } private: struct Pattern { - StringRef Pattern; + StringRef P; bool IsFullyQualified; }; llvm::SmallVector<Pattern, 8> Patterns; |

