https://bugs.llvm.org/show_bug.cgi?id=42832
Bug ID: 42832
Summary: -Wpessimizing-move and -Wredundant-move are applicable
only when returned expression is id-expression
Product: clang
Version: 8.0
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P
Component: C++17
Assignee: unassignedclangb...@nondot.org
Reporter: andrey.a.davy...@gmail.com
CC: blitzrak...@gmail.com, erik.pilking...@gmail.com,
llvm-bugs@lists.llvm.org, richard-l...@metafoo.co.uk
-Wredundant-move: (https://gcc.godbolt.org/z/j2CTqF)
std::unique_ptr<int> f(std::unique_ptr<int> param)
{
// clang shows "redundant move", but without it code doesn't compile
return { std::move(param) };
}
-Wpessimizing-move: (https://gcc.godbolt.org/z/2DIBcC)
std::unique_ptr<int> f()
{
std::unique_ptr<int> result;
// clang shows "pessimizing move", but without it code doesn't compile
return { std::move(result) };
}
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs