WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
212421
-Wdeprecated-copy caused by Bitmap copy assignment operator
https://bugs.webkit.org/show_bug.cgi?id=212421
Summary
-Wdeprecated-copy caused by Bitmap copy assignment operator
Michael Catanzaro
Reported
2020-05-27 11:26:37 PDT
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).
Attachments
Patch
(1.81 KB, patch)
2020-05-27 11:31 PDT
,
Michael Catanzaro
no flags
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Michael Catanzaro
Comment 1
2020-05-27 11:31:46 PDT
Created
attachment 400356
[details]
Patch
Mark Lam
Comment 2
2020-05-27 11:34:39 PDT
Comment on
attachment 400356
[details]
Patch Removal of the assignment operator is not an option. This was added as a step for upcoming work. I'll need to take a closer look at what the GCC complaint is and decide what the best solution is.
Mark Lam
Comment 3
2020-05-27 11:45:36 PDT
Comment on
attachment 400356
[details]
Patch I stand corrected. Michael pointed out on slack that the default assignment operator would take care of the job. There's no need for my hand written one. r=me if theAPI test bots are green.
Mark Lam
Comment 4
2020-05-27 12:51:57 PDT
Comment on
attachment 400356
[details]
Patch API bots are green. Landing this.
EWS
Comment 5
2020-05-27 13:15:52 PDT
Committed
r262211
: <
https://trac.webkit.org/changeset/262211
> All reviewed patches have been landed. Closing bug and clearing flags on
attachment 400356
[details]
.
Radar WebKit Bug Importer
Comment 6
2020-05-27 13:16:18 PDT
<
rdar://problem/63687389
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug