[clang-tools-extra] r205913 - Inject unique_ptr/shared_ptr into the test instead of using <memory>
Samuel Benzaquen
sbenza at google.com
Wed Apr 9 09:50:39 PDT 2014
Author: sbenza
Date: Wed Apr 9 11:50:38 2014
New Revision: 205913
URL: http://llvm.org/viewvc/llvm-project?rev=205913&view=rev
Log:
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
Modified:
clang-tools-extra/trunk/test/clang-tidy/redundant-smartptr-get-fix.cpp
clang-tools-extra/trunk/test/clang-tidy/redundant-smartptr-get.cpp
Modified: clang-tools-extra/trunk/test/clang-tidy/redundant-smartptr-get-fix.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/redundant-smartptr-get-fix.cpp?rev=205913&r1=205912&r2=205913&view=diff
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/redundant-smartptr-get-fix.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/redundant-smartptr-get-fix.cpp Wed Apr 9 11:50:38 2014
@@ -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();
Modified: clang-tools-extra/trunk/test/clang-tidy/redundant-smartptr-get.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/redundant-smartptr-get.cpp?rev=205913&r1=205912&r2=205913&view=diff
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/redundant-smartptr-get.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/redundant-smartptr-get.cpp Wed Apr 9 11:50:38 2014
@@ -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();
More information about the cfe-commits
mailing list