Closed
Bug 1373625
Opened 8 years ago
Closed 8 years ago
warning: lambda capture 'this' is not used [-Wunused-lambda-capture]
Categories
(Core :: Layout, defect)
Core
Layout
Tracking
()
RESOLVED
FIXED
mozilla56
Tracking | Status | |
---|---|---|
firefox56 | --- | fixed |
People
(Reporter: Sylvestre, Assigned: Sylvestre)
References
Details
Attachments
(1 file)
In file included from /home/sylvestre/dev/mozilla/mozilla-central.hg/obj-x86_64-pc-linux-gnu/layout/generic/Unified_cpp_layout_generic1.cpp:74:
/home/sylvestre/dev/mozilla/mozilla-central.hg/layout/generic/nsContainerFrame.cpp:336:24: warning: lambda capture 'this' is not used [-Wunused-lambda-capture]
mProperties.ForEach([this, aLists] (const T& aProp, void* aValue) {
^
Comment hidden (mozreview-request) |
Comment 2•8 years ago
|
||
It's needed for the IsFrameOfType() call in the MOZ_ASSERT,
so I don't think we can just remove it.
Comment 3•8 years ago
|
||
Perhaps we could make an exception and do a "capture all you need" in this case?
[=] I guess since they are both pointers.
Comment 4•8 years ago
|
||
mozreview-review |
Comment on attachment 8878457 [details]
Bug 1373625 - Silence a -Wunused-lambda-capture warning in nsContainerFrame.cpp
https://reviewboard.mozilla.org/r/149808/#review154564
r- on current patch, since (as mats notes) it won't compile with ac_add_options --enable-debug, due to the MOZ_ASSERT usage of "this".
If we really want to silence the warning, we could maybe just do...
Unused << this; // silence clang -Wunused-lambda-capture in opt builds
...right after the MOZ_ASSERT? *shrug*
Attachment #8878457 -
Flags: review?(dholbert) → review-
Comment 5•8 years ago
|
||
Sure, "Unused << this" works for me.
Updated•8 years ago
|
Flags: needinfo?(sledru)
Comment hidden (mozreview-request) |
Comment 8•8 years ago
|
||
mozreview-review |
Comment on attachment 8878457 [details]
Bug 1373625 - Silence a -Wunused-lambda-capture warning in nsContainerFrame.cpp
https://reviewboard.mozilla.org/r/149808/#review156344
r=me with two nits:
::: commit-message-fe809:1
(Diff revision 2)
> +Bug 1373625 - Silent a -Wunused-lambda-capture warning in nsContainerFrame.cpp r?dholbert
s/Silent/Silence/
::: layout/generic/nsContainerFrame.cpp:351
(Diff revision 2)
> "found unexpected ExcessOverflowContainersProperty");
> L(aValue)->AppendIfNonempty(aLists, kExcessOverflowContainersList);
> } else if (aProp == BackdropProperty()) {
> L(aValue)->AppendIfNonempty(aLists, kBackdropList);
> }
> + Unused << this; // silence clang -Wunused-lambda-capture in opt builds
Please put this new line *directly after* the MOZ_ASSERT, so that the debug-build-usage & the opt-build-hackaround are more clearly associated.
(And if we happen to remove the MOZ_ASSERT someday, we'll be more likely to realize that we should drop the Unused<< as well, and then the compiler can help us figure out to drop the [this] lambda capture.)
Attachment #8878457 -
Flags: review?(dholbert) → review+
Comment hidden (mozreview-request) |
Comment 10•8 years ago
|
||
Pushed by sledru@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/85c7a1f9a5b4
Silence a -Wunused-lambda-capture warning in nsContainerFrame.cpp r=dholbert
Assignee | ||
Updated•8 years ago
|
Blocks: Wunused-lambda-capture
Comment 11•8 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 8 years ago
status-firefox56:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla56
Updated•8 years ago
|
status-firefox57:
affected → ---
You need to log in
before you can comment on or make changes to this bug.
Description
•