[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
Thu Feb 15 14:47:18 PST 2018


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

Reword the diagnostic per rsmith's suggestions.
Still TODO:

- figure out how to detect whether this is a return-stmt or throw-expression
- figure out how to generate the appropriate fixit


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.134514.patch
Type: text/x-patch
Size: 27890 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180215/942b900b/attachment-0001.bin>


More information about the cfe-commits mailing list