Reland r160052: Default to -std=c++11 on Windows.
Also update the tests that rely on c++98 to explicitly mention that.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162890 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/unittests/ASTMatchers/ASTMatchersTest.h b/unittests/ASTMatchers/ASTMatchersTest.h
index 64816f5..6d872e8 100644
--- a/unittests/ASTMatchers/ASTMatchersTest.h
+++ b/unittests/ASTMatchers/ASTMatchersTest.h
@@ -18,7 +18,7 @@
namespace ast_matchers {
using clang::tooling::newFrontendActionFactory;
-using clang::tooling::runToolOnCode;
+using clang::tooling::runToolOnCodeWithArgs;
using clang::tooling::FrontendActionFactory;
class BoundNodesCallback {
@@ -56,7 +56,9 @@
MatchFinder Finder;
Finder.addMatcher(AMatcher, new VerifyMatch(0, &Found));
OwningPtr<FrontendActionFactory> Factory(newFrontendActionFactory(&Finder));
- if (!runToolOnCode(Factory->create(), Code)) {
+ // Some tests use typeof, which is a gnu extension.
+ std::vector<std::string> Args(1, "-std=gnu++98");
+ if (!runToolOnCodeWithArgs(Factory->create(), Code, Args)) {
return testing::AssertionFailure() << "Parsing error in \"" << Code << "\"";
}
if (!Found && ExpectMatch) {
@@ -91,7 +93,9 @@
Finder.addMatcher(
AMatcher, new VerifyMatch(FindResultVerifier, &VerifiedResult));
OwningPtr<FrontendActionFactory> Factory(newFrontendActionFactory(&Finder));
- if (!runToolOnCode(Factory->create(), Code)) {
+ // Some tests use typeof, which is a gnu extension.
+ std::vector<std::string> Args(1, "-std=gnu++98");
+ if (!runToolOnCodeWithArgs(Factory->create(), Code, Args)) {
return testing::AssertionFailure() << "Parsing error in \"" << Code << "\"";
}
if (!VerifiedResult && ExpectResult) {