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: unassignedclangb...@nondot.org
          Reporter: bunge...@gmail.com
                CC: blitzrak...@gmail.com, erik.pilking...@gmail.com,
                    llvm-bugs@lists.llvm.org, richard-l...@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.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to