rnk added a comment.

I'm not sure your example is in scope for -Wshadow, though. Any function call 
that takes a non-const reference to the parameter could modify it. I guess I'm 
thinking something like:

  void trim_in_place(std::string &s);
  struct A {
    std::string s;
    A(std::string s) : s(s) { trim_in_place(s); }
  };

I think if we try to match that we'll have too many false positives.

I think your example would be better caught by something like -Wconsumed that 
looks for uses of objects that have been moved-from. That warning won't be 
confused by shadowing and will give a better diagnostic anyway.


http://reviews.llvm.org/D18271



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to