[llvm-bugs] [Bug 45254] New: Fix redundant-move for CWG1579.

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Mar 19 13:33:55 PDT 2020


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

            Bug ID: 45254
           Summary: Fix redundant-move for CWG1579.
           Product: clang
           Version: 10.0
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++14
          Assignee: unassignedclangbugs at nondot.org
          Reporter: bungeman at gmail.com
                CC: blitzrakete at gmail.com, erik.pilkington at gmail.com,
                    llvm-bugs at lists.llvm.org, richard-llvm at metafoo.co.uk

In "D11615 Fix redundant move warning" the redundant-move diagnostic was
limited due to clang at the time not implementing CWG1579. Later with "D21619
[Sema] Implement C++14's DR1579: Prefer moving id-expression out of functions"
this was implemented, but the redundant-move diagnostic was not updated. In the
meantime gcc has implemented a redundant-move diagnostic which does support
CWG1579, so the diagnostics are confusingly different without need. Clang's
current redundant-move diagnostic would be better named
redundant-move-in-c++11.

This is somewhat complicated by the introduction in "D43322 Diagnose cases of
"return x" that should be "return std::move(x)" for efficiency" of
return-std-move-in-c++11 which is helpful if older toolchains need to be
supported. It would be nice if the redundant-move diagnostic were split into
redundant-move-in-c++11 and redundant-move since return-std-move-in-c++11 and a
full CWG1579 redundant-move are in conflict (by definition).

-- 
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/20200319/2ea16863/attachment.html>


More information about the llvm-bugs mailing list