Inject unique_ptr/shared_ptr into the test instead of using <memory>

Summary:
Inject unique_ptr/shared_ptr into the test instead of using <memory>
Libraries might not be present on tests.
This fixes the break introduces at rL205854.

Reviewers: klimek

CC: cfe-commits

Differential Revision: http://reviews.llvm.org/D3330

llvm-svn: 205913
This commit is contained in:
Samuel Benzaquen 2014-04-09 16:50:38 +00:00
parent 5b031ebc70
commit fec969a0af
2 changed files with 34 additions and 2 deletions

View File

@ -1,6 +1,22 @@
// RUN: $(dirname %s)/check_clang_tidy_fix.sh %s misc-redundant-smartptr-get %t
#include <memory>
namespace std {
template <typename T>
class unique_ptr {
T& operator*() const;
T* operator->() const;
T* get() const;
};
template <typename T>
class shared_ptr {
T& operator*() const;
T* operator->() const;
T* get() const;
};
} // namespace std
struct Bar {
void Do();

View File

@ -2,7 +2,23 @@
// CHECK-NOT: warning
#include <memory>
namespace std {
template <typename T>
class unique_ptr {
T& operator*() const;
T* operator->() const;
T* get() const;
};
template <typename T>
class shared_ptr {
T& operator*() const;
T* operator->() const;
T* get() const;
};
} // namespace std
struct int_ptr {
int* get();