[LLVMbugs] [Bug 23820] New: -Wredundant-move issued on non-redundant moves in C++11 (that would be redundant in C++14)

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Jun 11 13:42:35 PDT 2015


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

            Bug ID: 23820
           Summary: -Wredundant-move issued on non-redundant moves in
                    C++11 (that would be redundant in C++14)
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++11
          Assignee: unassignedclangbugs at nondot.org
          Reporter: richard-llvm at metafoo.co.uk
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

This produces a -Wredundant-move warning, but removing the std::move call makes
the code ill-formed in C++11:

  #include <utility>
  struct X { X(); X(X&&); };
  struct Y : X {};
  X f() { Y y; return std::move(y); }

The warning is correct in C++14.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20150611/a77515af/attachment.html>


More information about the llvm-bugs mailing list