ccotter marked 4 inline comments as done. ccotter added inline comments.
================ Comment at: clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines/rvalue-reference-param-not-moved.cpp:45 +template <typename T> +void never_moves_param_template(Obj&& o, T t) { + // CHECK-MESSAGES: :[[@LINE-1]]:33: warning: rvalue reference parameter is never moved from inside the function body [cppcoreguidelines-rvalue-reference-param-not-moved] ---------------- ccotter wrote: > carlosgalvezp wrote: > > Could we add something like this too? > > > > ``` > > template <typename T> > > struct Foo > > { > > void never_moves(T&& t) {} > > }; > > ``` > > > > Here `t` is not a universal reference so the check should warn. > Done in the `AClassTemplate::never_moves` test. @carlosgalvezp Note I've changed the check to not flag `never_moves` based on more recent discussion. I do think this code should flag, although I'm a little torn. If `Foo` constrains `T` to be a reference, then `Foo<Obj&>::never_moves` is "OK", although I think it's still confusing as `never_moves` could instead accept `T&`. I'll need to rethink this a bit, but I've never the test in place with a `FIXME` and brief comment explaining the situation. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D141569/new/ https://reviews.llvm.org/D141569 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits