diff options
| author | Samuel Benzaquen <sbenza@google.com> | 2014-04-29 13:41:23 +0000 |
|---|---|---|
| committer | Samuel Benzaquen <sbenza@google.com> | 2014-04-29 13:41:23 +0000 |
| commit | 20e93f39c1bfd578f7069ae19a8844a852b63115 (patch) | |
| tree | 144269530e7c7af24deb949c697b936f719d0de4 /clang-tools-extra/clang-tidy/misc/RedundantSmartptrGet.cpp | |
| parent | b3268e71e2f3476872860bc5b61172f8086fbb50 (diff) | |
| download | bcm5719-llvm-20e93f39c1bfd578f7069ae19a8844a852b63115.tar.gz bcm5719-llvm-20e93f39c1bfd578f7069ae19a8844a852b63115.zip | |
Do not touch get() calls on 'this' object.
Summary:
These calls are part of the implementation of the smart pointer itself
and chaning it is likely to be wrong.
Example:
T& operator*() const { return *get(); }
Reviewers: djasper
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D3540
llvm-svn: 207525
Diffstat (limited to 'clang-tools-extra/clang-tidy/misc/RedundantSmartptrGet.cpp')
| -rw-r--r-- | clang-tools-extra/clang-tidy/misc/RedundantSmartptrGet.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/clang-tools-extra/clang-tidy/misc/RedundantSmartptrGet.cpp b/clang-tools-extra/clang-tidy/misc/RedundantSmartptrGet.cpp index 97398af2977..d48d74c1125 100644 --- a/clang-tools-extra/clang-tidy/misc/RedundantSmartptrGet.cpp +++ b/clang-tools-extra/clang-tidy/misc/RedundantSmartptrGet.cpp @@ -22,6 +22,7 @@ internal::Matcher<Expr> callToGet(internal::Matcher<Decl> OnClass) { 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"); } |

