diff options
author | Nico Weber <nicolasweber@gmx.de> | 2012-08-30 02:08:31 +0000 |
---|---|---|
committer | Nico Weber <nicolasweber@gmx.de> | 2012-08-30 02:08:31 +0000 |
commit | 50f88b99c60c2ed31b339cd8bd484766cc9e916b (patch) | |
tree | 8f0093cfe8497e4f9a9b3139083e690017db2e52 /unittests | |
parent | 566698851d76416129cd20ceea02bdd697934c5c (diff) | |
download | clang-50f88b99c60c2ed31b339cd8bd484766cc9e916b.tar.gz |
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
Diffstat (limited to 'unittests')
-rw-r--r-- | unittests/AST/DeclPrinterTest.cpp | 2 | ||||
-rw-r--r-- | unittests/ASTMatchers/ASTMatchersTest.h | 10 |
2 files changed, 9 insertions, 3 deletions
diff --git a/unittests/AST/DeclPrinterTest.cpp b/unittests/AST/DeclPrinterTest.cpp index c99550af22..2800df4caf 100644 --- a/unittests/AST/DeclPrinterTest.cpp +++ b/unittests/AST/DeclPrinterTest.cpp @@ -73,6 +73,8 @@ bool runToolOnCode(clang::FrontendAction *ToolAction, const Twine &Code, std::vector<std::string> ArgVector; ArgVector.push_back("clang-tool"); ArgVector.push_back("-fsyntax-only"); + // operator delete (void*) grows a "noexcept" in c++11. + ArgVector.push_back("-std=c++98"); ArgVector.push_back(FileNameRef.data()); for (unsigned i = 0, e = ClangArgs.size(); i != e; ++i) ArgVector.push_back(ClangArgs[i]); diff --git a/unittests/ASTMatchers/ASTMatchersTest.h b/unittests/ASTMatchers/ASTMatchersTest.h index 64816f5d60..6d872e8ea9 100644 --- a/unittests/ASTMatchers/ASTMatchersTest.h +++ b/unittests/ASTMatchers/ASTMatchersTest.h @@ -18,7 +18,7 @@ namespace clang { 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 @@ testing::AssertionResult matchesConditionally(const std::string &Code, 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 @@ matchAndVerifyResultConditionally(const std::string &Code, const T &AMatcher, 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) { |