summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/cpp11-migrate/AddOverride/AddOverrideMatchers.cpp
blob: 1e27002f852d5d83cfe1b672715115b663af9f2e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
//===-- AddOverride/AddOverrideMatchers.cpp - C++11 override ---*- C++ -*-===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
///
///  \file
///  \brief This file contains the definitions for matcher-generating functions
///  and a custom AST_MATCHER for identifying casts of type CK_NullTo*.
///
//===----------------------------------------------------------------------===//
#include "AddOverrideMatchers.h"
#include "clang/AST/ASTContext.h"

using namespace clang::ast_matchers;
using namespace clang;

const char *MethodId = "method";

DeclarationMatcher makeCandidateForOverrideAttrMatcher() {
  return methodDecl(hasParent(recordDecl()),
                    isOverride(),
                    unless(destructorDecl())).bind(MethodId);
}

OpenPOWER on IntegriCloud