https://llvm.org/bugs/show_bug.cgi?id=23819

            Bug ID: 23819
           Summary: -Wpessimizing-move sometimes issued where
                    -Wredundant-move would be appropriate
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++11
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected]
    Classification: Unclassified

Case 1: "moving a temporary object prevents copy elision" diagnosed even though
no copy would be made anyway:

  struct X {};
  X g();
  void h(X&&);
  void f() { h(std::move(g())); }

Case 2: "moving a local object in a return statement prevents copy elision"
issued even though copy elision is not possible, because we're returning a
function parameter:

  X f(X x) { return std::move(x); }

In both of these cases we should issue a -Wredundant-move warning instead.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to