diff options
| author | James Dennett <jdennett@google.com> | 2013-06-30 03:05:49 +0000 |
|---|---|---|
| committer | James Dennett <jdennett@google.com> | 2013-06-30 03:05:49 +0000 |
| commit | eb576c0a061bad79b718c71175939bce03ffec3f (patch) | |
| tree | c43c6696847ee8c101a86b09d6a9d4ab6aff2d6a | |
| parent | 8bd1771abe44d1027460bcd1d7edcab556f75428 (diff) | |
| download | bcm5719-llvm-eb576c0a061bad79b718c71175939bce03ffec3f.tar.gz bcm5719-llvm-eb576c0a061bad79b718c71175939bce03ffec3f.zip | |
Add enumerators to TestVisitor::Language to allow visitor tests to
explicitly specify use of C++98 or C++11. Lang_CXX is preserved as
an alias for Lang_CXX98.
This does not add Lang_CXX1Y or Lang_C11, on the assumption that it's
better to add them if/when they are needed.
(This is a prerequisite for a test in a later patch for RecursiveASTVisitor.)
Reviewed by Richard Smith.
llvm-svn: 185276
| -rw-r--r-- | clang/unittests/Tooling/TestVisitor.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/unittests/Tooling/TestVisitor.h b/clang/unittests/Tooling/TestVisitor.h index ce3246a902f..5ee118ebdcc 100644 --- a/clang/unittests/Tooling/TestVisitor.h +++ b/clang/unittests/Tooling/TestVisitor.h @@ -39,14 +39,15 @@ public: virtual ~TestVisitor() { } - enum Language { Lang_C, Lang_CXX }; + enum Language { Lang_C, Lang_CXX98, Lang_CXX11, Lang_CXX=Lang_CXX98 }; /// \brief Runs the current AST visitor over the given code. bool runOver(StringRef Code, Language L = Lang_CXX) { std::vector<std::string> Args; switch (L) { case Lang_C: Args.push_back("-std=c99"); break; - case Lang_CXX: Args.push_back("-std=c++98"); break; + case Lang_CXX98: Args.push_back("-std=c++98"); break; + case Lang_CXX11: Args.push_back("-std=c++11"); break; } return tooling::runToolOnCodeWithArgs(CreateTestAction(), Code, Args); } |

