Index: test/clang-tidy/redundant-smartptr-get-fix.cpp =================================================================== --- test/clang-tidy/redundant-smartptr-get-fix.cpp +++ test/clang-tidy/redundant-smartptr-get-fix.cpp @@ -1,6 +1,22 @@ // RUN: $(dirname %s)/check_clang_tidy_fix.sh %s misc-redundant-smartptr-get %t -#include +namespace std { + +template +class unique_ptr { + T& operator*() const; + T* operator->() const; + T* get() const; +}; + +template +class shared_ptr { + T& operator*() const; + T* operator->() const; + T* get() const; +}; + +} // namespace std struct Bar { void Do(); Index: test/clang-tidy/redundant-smartptr-get.cpp =================================================================== --- test/clang-tidy/redundant-smartptr-get.cpp +++ test/clang-tidy/redundant-smartptr-get.cpp @@ -2,7 +2,23 @@ // CHECK-NOT: warning -#include +namespace std { + +template +class unique_ptr { + T& operator*() const; + T* operator->() const; + T* get() const; +}; + +template +class shared_ptr { + T& operator*() const; + T* operator->() const; + T* get() const; +}; + +} // namespace std struct int_ptr { int* get();