Hi,

GCC 9 has new -Wpessimizing-move ("warning: moving a local object in a return statement prevents copy elision") and -Wredundant-move ("warning: redundant move in return statement") warnings. These are enabled by -Wextra (which we use) and will be triggered by code like:

return WTFMove(foo);

when foo is a copyable type. This idiom is only appropriate if foo is a noncopyable (move-only) type. We have many, many instances of such code. I'm trying to fix them. Please don't add more! (It's easy enough to disable the warnings, but they're there for a reason.)

Thanks,

Michael


_______________________________________________
webkit-dev mailing list
webkit-dev@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-dev

Reply via email to