summaryrefslogtreecommitdiffstats
path: root/clang/unittests/ASTMatchers
diff options
context:
space:
mode:
Diffstat (limited to 'clang/unittests/ASTMatchers')
-rw-r--r--clang/unittests/ASTMatchers/ASTMatchersTest.cpp26
-rw-r--r--clang/unittests/ASTMatchers/Dynamic/ParserTest.cpp7
2 files changed, 15 insertions, 18 deletions
diff --git a/clang/unittests/ASTMatchers/ASTMatchersTest.cpp b/clang/unittests/ASTMatchers/ASTMatchersTest.cpp
index 7edec96c0f3..4b0580a8147 100644
--- a/clang/unittests/ASTMatchers/ASTMatchersTest.cpp
+++ b/clang/unittests/ASTMatchers/ASTMatchersTest.cpp
@@ -747,12 +747,12 @@ public:
Name.clear();
}
- ~VerifyIdIsBoundTo() {
+ ~VerifyIdIsBoundTo() override {
EXPECT_EQ(0, Count);
EXPECT_EQ("", Name);
}
- virtual bool run(const BoundNodes *Nodes) override {
+ bool run(const BoundNodes *Nodes) override {
const BoundNodes::IDToNodeMap &M = Nodes->getMap();
if (Nodes->getNodeAs<T>(Id)) {
++Count;
@@ -774,7 +774,7 @@ public:
return false;
}
- virtual bool run(const BoundNodes *Nodes, ASTContext *Context) override {
+ bool run(const BoundNodes *Nodes, ASTContext *Context) override {
return run(Nodes);
}
@@ -4379,9 +4379,9 @@ public:
: Id(Id), InnerMatcher(InnerMatcher), InnerId(InnerId) {
}
- virtual bool run(const BoundNodes *Nodes) { return false; }
+ bool run(const BoundNodes *Nodes) override { return false; }
- virtual bool run(const BoundNodes *Nodes, ASTContext *Context) {
+ bool run(const BoundNodes *Nodes, ASTContext *Context) override {
const T *Node = Nodes->getNodeAs<T>(Id);
return selectFirst<T>(InnerId, match(InnerMatcher, *Node, *Context)) !=
nullptr;
@@ -4430,9 +4430,9 @@ TEST(MatchFinder, CanMatchSingleNodesRecursively) {
template <typename T>
class VerifyAncestorHasChildIsEqual : public BoundNodesCallback {
public:
- virtual bool run(const BoundNodes *Nodes) { return false; }
+ bool run(const BoundNodes *Nodes) override { return false; }
- virtual bool run(const BoundNodes *Nodes, ASTContext *Context) {
+ bool run(const BoundNodes *Nodes, ASTContext *Context) override {
const T *Node = Nodes->getNodeAs<T>("");
return verify(*Nodes, *Context, Node);
}
@@ -4488,12 +4488,10 @@ TEST(MatchFinder, CheckProfiling) {
class VerifyStartOfTranslationUnit : public MatchFinder::MatchCallback {
public:
VerifyStartOfTranslationUnit() : Called(false) {}
- virtual void run(const MatchFinder::MatchResult &Result) {
+ void run(const MatchFinder::MatchResult &Result) override {
EXPECT_TRUE(Called);
}
- virtual void onStartOfTranslationUnit() {
- Called = true;
- }
+ void onStartOfTranslationUnit() override { Called = true; }
bool Called;
};
@@ -4516,12 +4514,10 @@ TEST(MatchFinder, InterceptsStartOfTranslationUnit) {
class VerifyEndOfTranslationUnit : public MatchFinder::MatchCallback {
public:
VerifyEndOfTranslationUnit() : Called(false) {}
- virtual void run(const MatchFinder::MatchResult &Result) {
+ void run(const MatchFinder::MatchResult &Result) override {
EXPECT_FALSE(Called);
}
- virtual void onEndOfTranslationUnit() {
- Called = true;
- }
+ void onEndOfTranslationUnit() override { Called = true; }
bool Called;
};
diff --git a/clang/unittests/ASTMatchers/Dynamic/ParserTest.cpp b/clang/unittests/ASTMatchers/Dynamic/ParserTest.cpp
index 2a9a61b543d..5e6cadd1962 100644
--- a/clang/unittests/ASTMatchers/Dynamic/ParserTest.cpp
+++ b/clang/unittests/ASTMatchers/Dynamic/ParserTest.cpp
@@ -23,7 +23,7 @@ namespace {
class MockSema : public Parser::Sema {
public:
- virtual ~MockSema() {}
+ ~MockSema() override {}
uint64_t expectMatcher(StringRef MatcherName) {
// Optimizations on the matcher framework make simple matchers like
@@ -42,7 +42,8 @@ public:
Errors.push_back(Error.toStringFull());
}
- llvm::Optional<MatcherCtor> lookupMatcherCtor(StringRef MatcherName) {
+ llvm::Optional<MatcherCtor>
+ lookupMatcherCtor(StringRef MatcherName) override {
const ExpectedMatchersTy::value_type *Matcher =
&*ExpectedMatchers.find(MatcherName);
return reinterpret_cast<MatcherCtor>(Matcher);
@@ -52,7 +53,7 @@ public:
const SourceRange &NameRange,
StringRef BindID,
ArrayRef<ParserValue> Args,
- Diagnostics *Error) {
+ Diagnostics *Error) override {
const ExpectedMatchersTy::value_type *Matcher =
reinterpret_cast<const ExpectedMatchersTy::value_type *>(Ctor);
MatcherInfo ToStore = { Matcher->first, NameRange, Args, BindID };
OpenPOWER on IntegriCloud