[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
Wed Mar 14 14:57:51 PDT 2018


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

Boldly add `-Wreturn-std-move` to `-Wmove` (and thus also to `-Wall`).
The backward-compatibility-concerned diagnostic, `-Wreturn-std-move-in-c++11`, is *not* appropriate for `-Wmove`; but I believe this main diagnostic is appropriate.


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.138457.patch
Type: text/x-patch
Size: 34291 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180314/418300a4/attachment-0001.bin>


More information about the cfe-commits mailing list