diff --git a/clang/unittests/AST/MatchVerifier.h b/clang/unittests/AST/MatchVerifier.h index 56dcc68f2022..bc8bf9ea3479 100644 --- a/clang/unittests/AST/MatchVerifier.h +++ b/clang/unittests/AST/MatchVerifier.h @@ -34,12 +34,23 @@ public: template testing::AssertionResult match(const std::string &Code, const MatcherType &AMatcher) { - return match(Code, AMatcher, Lang_CXX); + std::vector Args; + return match(Code, AMatcher, Args, Lang_CXX); } template testing::AssertionResult match(const std::string &Code, - const MatcherType &AMatcher, Language L); + const MatcherType &AMatcher, + Language L) { + std::vector Args; + return match(Code, AMatcher, Args, L); + } + + template + testing::AssertionResult match(const std::string &Code, + const MatcherType &AMatcher, + std::vector& Args, + Language L); protected: virtual void run(const MatchFinder::MatchResult &Result); @@ -64,13 +75,13 @@ private: /// verifier for the matched node. template template testing::AssertionResult MatchVerifier::match( - const std::string &Code, const MatcherType &AMatcher, Language L) { + const std::string &Code, const MatcherType &AMatcher, + std::vector& Args, Language L) { MatchFinder Finder; Finder.addMatcher(AMatcher.bind(""), this); OwningPtr Factory( tooling::newFrontendActionFactory(&Finder)); - std::vector Args; StringRef FileName; switch (L) { case Lang_C: diff --git a/clang/unittests/AST/SourceLocationTest.cpp b/clang/unittests/AST/SourceLocationTest.cpp index 4a4250710a95..95ef2c425b5c 100644 --- a/clang/unittests/AST/SourceLocationTest.cpp +++ b/clang/unittests/AST/SourceLocationTest.cpp @@ -211,21 +211,18 @@ TEST(CXXFunctionalCastExpr, SourceRange) { functionalCastExpr(), Lang_CXX11)); } -#if !defined(_MSC_VER) -// FIXME: It could pass if MS-compatible mode were disabled. -// Args.push_back("-fno-delayed-template-parsing"); - TEST(CXXUnresolvedConstructExpr, SourceRange) { RangeVerifier Verifier; Verifier.expectRange(3, 10, 3, 12); + std::vector Args; + Args.push_back("-fno-delayed-template-parsing"); EXPECT_TRUE(Verifier.match( "template \n" "U foo() {\n" " return U{};\n" "}", - unresolvedConstructExpr(), Lang_CXX11)); + unresolvedConstructExpr(), Args, Lang_CXX11)); } -#endif } // end namespace ast_matchers } // end namespace clang