[InstCombine] Drop range attributes in `foldBitCeil` (#116641)
[llvm-project.git] / clang-tools-extra / clang-tidy / modernize / MakeUniqueCheck.h
blob7b356823a8cfab4a1c25fed4ec0710225316b17c
1 //===--- MakeUniqueCheck.h - clang-tidy--------------------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
9 #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_MAKE_UNIQUE_H
10 #define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_MAKE_UNIQUE_H
12 #include "MakeSmartPtrCheck.h"
14 namespace clang::tidy::modernize {
16 /// Replace the pattern:
17 /// \code
18 /// std::unique_ptr<type>(new type(args...))
19 /// \endcode
20 ///
21 /// With the C++14 version:
22 /// \code
23 /// std::make_unique<type>(args...)
24 /// \endcode
25 class MakeUniqueCheck : public MakeSmartPtrCheck {
26 public:
27 MakeUniqueCheck(StringRef Name, ClangTidyContext *Context);
29 protected:
30 SmartPtrTypeMatcher getSmartPointerTypeMatcher() const override;
32 bool isLanguageVersionSupported(const LangOptions &LangOpts) const override;
34 private:
35 const bool RequireCPlusPlus14;
38 } // namespace clang::tidy::modernize
40 #endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_MAKE_UNIQUE_H