[PATCH] D35937: [clang-tidy] Add new readability non-idiomatic static access

Gábor Horváth via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 28 00:55:32 PDT 2017


xazax.hun added inline comments.


================
Comment at: test/clang-tidy/readability-static-accessed-through-instance.cpp:34
+  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: static member accessed through instance  [readability-static-accessed-through-instance]
+  // CHECK-FIXES: {{^}}  C::x;{{$}}
+}
----------------
baloghadamsoftware wrote:
> aaron.ballman wrote:
> > This fix-it worries me because it changes the semantics of the code. The function `f()` is no longer called, and so this isn't a valid source transformation.
> Maybe the correct fix would be here f(1, 2, 3, 4); C::x;
Maybe for now we should just skip this cases. Expr::HasSideEffects might be a  good candidate to filter these cases. 


Repository:
  rL LLVM

https://reviews.llvm.org/D35937





More information about the cfe-commits mailing list