[PATCH] D30547: [clang-tidy] Forwarding reference overload in constructors

AndrĂ¡s Leitereg via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Mar 4 01:51:17 PST 2017


leanil marked 6 inline comments as done.
leanil added inline comments.


================
Comment at: test/clang-tidy/misc-forwarding-reference-overload.cpp:21
+  Person(T &&n);
+  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: function 'Person' can hide copy and move constructors [misc-forwarding-reference-overload]
+
----------------
JonasToth wrote:
> could the check output a note when there was a userdefined constructor and point to that one if it gets hidden? that would make it clearer, what and how the problem occurs. 
What do you mean by "if it gets hidden"? Should I look for specific calls that are hijacked by the perfect forwarding ctor? Or just make a note on the user defined copy/move ctors any time I produce a warning (without looking at actual calls)?
I think the former would be quite tricky to do.
Also, what if the perfect forwarding ctor hides the compiler generated copy/move? Should I still make a note (maybe pointing to the class itself)?


Repository:
  rL LLVM

https://reviews.llvm.org/D30547





More information about the cfe-commits mailing list