summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Dennett <jdennett@google.com>2013-06-30 03:05:49 +0000
committerJames Dennett <jdennett@google.com>2013-06-30 03:05:49 +0000
commit17aa33f34e15ed6317590cfbd3bd31bb634ba4f3 (patch)
tree55cd2e17e7009034ff89a859c7df8317a84bfd09
parente103979ceac63c98873f3307ee897eab559356a0 (diff)
downloadclang-17aa33f34e15ed6317590cfbd3bd31bb634ba4f3.tar.gz
clang-17aa33f34e15ed6317590cfbd3bd31bb634ba4f3.tar.bz2
clang-17aa33f34e15ed6317590cfbd3bd31bb634ba4f3.tar.xz
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185276 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--unittests/Tooling/TestVisitor.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/unittests/Tooling/TestVisitor.h b/unittests/Tooling/TestVisitor.h
index ce3246a902..5ee118ebdc 100644
--- a/unittests/Tooling/TestVisitor.h
+++ b/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);
}