summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/test/clang-tidy/modernize-make-shared.cpp
diff options
context:
space:
mode:
authorHaojian Wu <hokein@google.com>2017-07-05 07:49:00 +0000
committerHaojian Wu <hokein@google.com>2017-07-05 07:49:00 +0000
commit040c0f96ccac253ae4bfd9ce807e268b4ced155f (patch)
tree74824b4e4f5f0cd3fdb3c5ba9f888f9e1b62ffec /clang-tools-extra/test/clang-tidy/modernize-make-shared.cpp
parentd19389a3c946e2d66be9db203c0e9e57663a89f7 (diff)
downloadbcm5719-llvm-040c0f96ccac253ae4bfd9ce807e268b4ced155f.tar.gz
bcm5719-llvm-040c0f96ccac253ae4bfd9ce807e268b4ced155f.zip
[clang-tidy] Add "MakeSmartPtrFunction" option to modernize-make-shared/unique checks.
Reviewers: alexfh, aaron.ballman Reviewed By: alexfh Subscribers: JDevlieghere, Eugene.Zelenko, xazax.hun, cfe-commits Differential Revision: https://reviews.llvm.org/D34206 llvm-svn: 307130
Diffstat (limited to 'clang-tools-extra/test/clang-tidy/modernize-make-shared.cpp')
-rw-r--r--clang-tools-extra/test/clang-tidy/modernize-make-shared.cpp28
1 files changed, 4 insertions, 24 deletions
diff --git a/clang-tools-extra/test/clang-tidy/modernize-make-shared.cpp b/clang-tools-extra/test/clang-tidy/modernize-make-shared.cpp
index 4f478419dc4..ed4da998ec5 100644
--- a/clang-tools-extra/test/clang-tidy/modernize-make-shared.cpp
+++ b/clang-tools-extra/test/clang-tidy/modernize-make-shared.cpp
@@ -1,28 +1,8 @@
-// RUN: %check_clang_tidy %s modernize-make-shared %t
+// RUN: %check_clang_tidy %s modernize-make-shared %t -- -- -std=c++11 \
+// RUN: -I%S/Inputs/modernize-smart-ptr
-namespace std {
-
-template <typename type>
-class shared_ptr {
-public:
- shared_ptr();
- shared_ptr(type *ptr);
- shared_ptr(const shared_ptr<type> &t) {}
- shared_ptr(shared_ptr<type> &&t) {}
- ~shared_ptr();
- type &operator*() { return *ptr; }
- type *operator->() { return ptr; }
- type *release();
- void reset();
- void reset(type *pt);
- shared_ptr &operator=(shared_ptr &&);
- template <typename T>
- shared_ptr &operator=(shared_ptr<T> &&);
-
-private:
- type *ptr;
-};
-}
+#include "shared_ptr.h"
+// CHECK-FIXES: #include <memory>
struct Base {
Base();
OpenPOWER on IntegriCloud