[llvm-bugs] [Bug 48464] New: performance-no-automatic-move should accept a list of classes to be ignored

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Dec 9 12:31:30 PST 2020


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

            Bug ID: 48464
           Summary: performance-no-automatic-move should accept a list of
                    classes to be ignored
           Product: clang
           Version: 11.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Tooling
          Assignee: unassignedclangbugs at nondot.org
          Reporter: aacid at kde.org
                CC: llvm-bugs at lists.llvm.org

I see the point for some classes, but take for example Qt classes like QString
that is refcounted, returning it by copy is as good as returning it by move
because all that happens is that the internal refcounter is updated.

But if if you have a long function with

const QString foo = ...

// lots of code

return foo;

it's worth foo being const since it won't be slower than if it wasn't and
prevents you making the mistake of changing foo.

That's why i think it'd be good if there was a way to tell
performance-no-automatic-move to ignore some classes from the check.

-- 
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/20201209/2037d5ab/attachment.html>


More information about the llvm-bugs mailing list