Index: clang-tidy/misc/RedundantSmartptrGet.cpp =================================================================== --- clang-tidy/misc/RedundantSmartptrGet.cpp +++ clang-tidy/misc/RedundantSmartptrGet.cpp @@ -22,6 +22,7 @@ on(expr(anyOf(hasType(OnClass), hasType(qualType(pointsTo(decl(OnClass).bind( "ptr_to_ptr")))))).bind("smart_pointer")), + unless(callee(memberExpr(hasObjectExpression(thisExpr())))), callee(methodDecl(hasName("get")))).bind("redundant_get"); } Index: test/clang-tidy/redundant-smartptr-get.cpp =================================================================== --- test/clang-tidy/redundant-smartptr-get.cpp +++ test/clang-tidy/redundant-smartptr-get.cpp @@ -81,6 +81,16 @@ // CHECK-NOT: warning void Negative() { + struct NegPtr { + int* get(); + int* operator->() { + return &*this->get(); + } + int& operator*() { + return *get(); + } + }; + std::unique_ptr* u; u->get()->Do();