clang-tools  6.0.0
DeprecatedHeadersCheck.h
Go to the documentation of this file.
1 //===--- DeprecatedHeadersCheck.h - clang-tidy-------------------*- C++ -*-===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 
10 #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_C_HEADERS_TO_CXX_H
11 #define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_C_HEADERS_TO_CXX_H
12 
13 #include "../ClangTidy.h"
14 
15 namespace clang {
16 namespace tidy {
17 namespace modernize {
18 
19 /// This check replaces deprecated C library headers with their C++ STL
20 /// alternatives.
21 ///
22 /// Before:
23 /// ~~~{.cpp}
24 /// #include <header.h>
25 /// ~~~
26 ///
27 /// After:
28 /// ~~~{.cpp}
29 /// #include <cheader>
30 /// ~~~
31 ///
32 /// Example: ``<stdio.h> => <cstdio>``
33 ///
34 /// For the user-facing documentation see:
35 /// http://clang.llvm.org/extra/clang-tidy/checks/modernize-deprecated-headers.html
37 public:
39  : ClangTidyCheck(Name, Context) {}
40  void registerPPCallbacks(CompilerInstance &Compiler) override;
41 };
42 
43 } // namespace modernize
44 } // namespace tidy
45 } // namespace clang
46 
47 #endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_C_HEADERS_TO_CXX_H
StringHandle Name
Base class for all clang-tidy checks.
Definition: ClangTidy.h:127
This check replaces deprecated C library headers with their C++ STL alternatives. ...
DeprecatedHeadersCheck(StringRef Name, ClangTidyContext *Context)
Every ClangTidyCheck reports errors through a DiagnosticsEngine provided by this context.
void registerPPCallbacks(CompilerInstance &Compiler) override
Override this to register PPCallbacks with Compiler.