From: Hans Wennborg Date: Mon, 22 Feb 2016 22:21:58 +0000 (+0000) Subject: Fix Visual Studio build after r261574 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=92d47304304b636375dd6ad0d6b004970dfd2d3a;p=clang Fix Visual Studio build after r261574 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261583 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/ASTMatchers/ASTMatchers.h b/include/clang/ASTMatchers/ASTMatchers.h index 29cce667e1..21a49691cd 100644 --- a/include/clang/ASTMatchers/ASTMatchers.h +++ b/include/clang/ASTMatchers/ASTMatchers.h @@ -1845,7 +1845,9 @@ inline internal::Matcher sizeOfExpr( /// namespace a { namespace b { class X; } } /// \endcode inline internal::Matcher hasName(const std::string &Name) { - return internal::Matcher(new internal::HasNameMatcher({Name})); + std::vector Names; + Names.push_back(Name); + return internal::Matcher(new internal::HasNameMatcher(Names)); } /// \brief Matches NamedDecl nodes that have any of the specified names. diff --git a/lib/ASTMatchers/ASTMatchersInternal.cpp b/lib/ASTMatchers/ASTMatchersInternal.cpp index ad785b5d61..ed48d7718a 100644 --- a/lib/ASTMatchers/ASTMatchersInternal.cpp +++ b/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 Patterns;