diff options
| author | Richard Trieu <rtrieu@google.com> | 2015-07-29 23:47:19 +0000 |
|---|---|---|
| committer | Richard Trieu <rtrieu@google.com> | 2015-07-29 23:47:19 +0000 |
| commit | 1993dc8b15d4d8835e773499240fad2da1152fb2 (patch) | |
| tree | 1109c4ae70643e68fc780103d7718f4f5bed06c4 /clang/test/SemaCXX/warn-pessmizing-move.cpp | |
| parent | b98aa4359af0c69365bfd471c95df34127e1e16b (diff) | |
| download | bcm5719-llvm-1993dc8b15d4d8835e773499240fad2da1152fb2.tar.gz bcm5719-llvm-1993dc8b15d4d8835e773499240fad2da1152fb2.zip | |
Fix -Wredundant-move warning.
Without DR1579 implemented, the only case for -Wredundant-move is for a
parameter being returned with the same type as the function return type. Also
include a check to verify that the move constructor will be used by matching
nodes in the AST dump.
llvm-svn: 243594
Diffstat (limited to 'clang/test/SemaCXX/warn-pessmizing-move.cpp')
| -rw-r--r-- | clang/test/SemaCXX/warn-pessmizing-move.cpp | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/clang/test/SemaCXX/warn-pessmizing-move.cpp b/clang/test/SemaCXX/warn-pessmizing-move.cpp index 5645564c74a..71e99dca007 100644 --- a/clang/test/SemaCXX/warn-pessmizing-move.cpp +++ b/clang/test/SemaCXX/warn-pessmizing-move.cpp @@ -200,8 +200,6 @@ A test10() { namespace templates { struct A {}; struct B { B(A); }; - struct C { C(); C(C&&); }; - struct D { D(C); }; // Warn once here since the type is not dependent. template <typename T> @@ -216,12 +214,9 @@ namespace templates { void run_test1() { test1<A>(); test1<B>(); - test1<C>(); - test1<D>(); } - // Either a pessimizing move, a redundant move, or no warning could be - // emitted, given the right types. So just drop the warning. + // T1 and T2 may not be the same, the warning may not always apply. template <typename T1, typename T2> T1 test2() { T2 t; @@ -230,6 +225,5 @@ namespace templates { void run_test2() { test2<A, A>(); test2<B, A>(); - test2<D, C>(); } } |

