[Webkit-unassigned] [Bug 212421] New: -Wdeprecated-copy caused by Bitmap copy assignment operator

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed May 27 11:26:37 PDT 2020


https://bugs.webkit.org/show_bug.cgi?id=212421

            Bug ID: 212421
           Summary: -Wdeprecated-copy caused by Bitmap copy assignment
                    operator
           Product: WebKit
           Version: WebKit Nightly Build
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: Web Template Framework
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: mcatanzaro at gnome.org

Continued from bug #212190, r262030 introduced a warning spam with GCC:

introduced a nice GCC warning spam:

In file included from DerivedSources/JavaScriptCore/unified-sources/UnifiedSource-f0a787a9-2.cpp:5:
/home/mcatanzaro/Projects/WebKit/Source/JavaScriptCore/bytecode/BytecodeLivenessAnalysis.cpp:194:16: warning: implicitly-declared ‘constexpr WTF::Bitmap<4>::Bitmap(const WTF::Bitmap<4>&)’ is deprecated [-Wdeprecated-copy]
  194 |         return result;
      |                ^~~~~~

because:

DerivedSources/ForwardingHeaders/wtf/Bitmap.h:480:13: note: because ‘WTF::Bitmap<4>’ has user-provided ‘void WTF::Bitmap<bitmapSize, WordType>::operator=(const WTF::Bitmap<bitmapSize, WordType>&) [with long unsigned int bitmapSize = 4; WordType = unsigned int]’
  480 | inline void Bitmap<bitmapSize, WordType>::operator=(const Bitmap& other)
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

To avoid the warning, we should either (a) remove the copy assignment operator, or (b) add a copy constructor. Either way would be fine, but in this case I'd prefer (a) because I don't think the new copy assignment operator is needed. It uses a loop to manually copy the bits of the sole member variable, a std::array, but a default copy of the array should be equivalent (and possibly also a bit faster).

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20200527/d0510c9b/attachment.htm>


More information about the webkit-unassigned mailing list