From 040c0f96ccac253ae4bfd9ce807e268b4ced155f Mon Sep 17 00:00:00 2001 From: Haojian Wu Date: Wed, 5 Jul 2017 07:49:00 +0000 Subject: [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 --- .../test/clang-tidy/modernize-make-shared.cpp | 28 ++++------------------ 1 file changed, 4 insertions(+), 24 deletions(-) (limited to 'clang-tools-extra/test/clang-tidy/modernize-make-shared.cpp') 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 -class shared_ptr { -public: - shared_ptr(); - shared_ptr(type *ptr); - shared_ptr(const shared_ptr &t) {} - shared_ptr(shared_ptr &&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 - shared_ptr &operator=(shared_ptr &&); - -private: - type *ptr; -}; -} +#include "shared_ptr.h" +// CHECK-FIXES: #include struct Base { Base(); -- cgit v1.2.3