[PATCH] D43322: Diagnose cases of "return x" that should be "return std::move(x)" for efficiency

Arthur O'Dwyer via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 19 21:28:28 PST 2018


Quuxplusone updated this revision to Diff 135005.
Quuxplusone added a comment.

Removed a redundant check for LValueReferenceType in the CWG1579 codepath. (In that branch, we know that standard C++ *did* perform the copy-to-move transformation, so obviously we can't have had an lvalue reference type originally.) I've verified that the check is still needed (not redundant) along the other codepath.


Repository:
  rC Clang

https://reviews.llvm.org/D43322

Files:
  include/clang/Basic/DiagnosticGroups.td
  include/clang/Basic/DiagnosticSemaKinds.td
  include/clang/Sema/Sema.h
  lib/Sema/SemaExprCXX.cpp
  lib/Sema/SemaStmt.cpp
  lib/Sema/SemaTemplateInstantiateDecl.cpp
  test/SemaCXX/warn-return-std-move.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D43322.135005.patch
Type: text/x-patch
Size: 32755 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180220/5a73a13f/attachment-0001.bin>


More information about the cfe-commits mailing list