Closed
Bug 1214037
Opened 9 years ago
Closed 9 years ago
MOZ_MUST_USE treats expressions evaluating to lvalue references as MUST_USE
Categories
(Developer Infrastructure :: Source Code Analysis, defect)
Developer Infrastructure
Source Code Analysis
Tracking
(firefox44 fixed)
RESOLVED
FIXED
mozilla44
Tracking | Status | |
---|---|---|
firefox44 | --- | fixed |
People
(Reporter: nika, Assigned: nika)
References
Details
Attachments
(1 file, 1 obsolete file)
8.09 KB,
patch
|
ehsan.akhgari
:
review+
|
Details | Diff | Splinter Review |
This means that we have some annoying effects, such as making `a = b` where the type of `a` is MOZ_MUST_USE complain about an unused value (as the assignment expression returns an lvalue reference to the variable). Another option would be to instead special-case the assignment operator.
Assignee | ||
Updated•9 years ago
|
Assignee: nobody → michael
Assignee | ||
Comment 1•9 years ago
|
||
Attachment #8673469 -
Flags: review?(ehsan)
Comment 2•9 years ago
|
||
Comment on attachment 8673469 [details] [diff] [review] Don't consider lvalue references to MOZ_MUST_USE types as MOZ_MUST_USE Review of attachment 8673469 [details] [diff] [review]: ----------------------------------------------------------------- I think this is a quirk of built-in operator=(), and it's definitely the wrong thing to white-list this for types such as already_AddRefed. I'd prefer if you special case operator=() assuming that is the only thing that blows up, and Seth's try push seems to suggest that.
Attachment #8673469 -
Flags: review?(ehsan) → review-
Assignee | ||
Comment 3•9 years ago
|
||
Attachment #8673469 -
Attachment is obsolete: true
Attachment #8673817 -
Flags: review?(ehsan)
Assignee | ||
Comment 4•9 years ago
|
||
a SA run on try: https://treeherder.mozilla.org/#/jobs?repo=try&revision=0df3260d0bf3
Comment 5•9 years ago
|
||
Comment on attachment 8673817 [details] [diff] [review] Don't consider the result of an assignment expression MOZ_MUST_USE Review of attachment 8673817 [details] [diff] [review]: ----------------------------------------------------------------- Great, thanks a lot!
Attachment #8673817 -
Flags: review?(ehsan) → review+
Comment 7•9 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/ab276d264008
Status: NEW → RESOLVED
Closed: 9 years ago
status-firefox44:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla44
Updated•6 years ago
|
Product: Core → Firefox Build System
Updated•2 years ago
|
Product: Firefox Build System → Developer Infrastructure
You need to log in
before you can comment on or make changes to this bug.
Description
•