MOZ_MUST_USE treats expressions evaluating to lvalue references as MUST_USE

RESOLVED FIXED in Firefox 48

Status

RESOLVED FIXED
3 years ago
7 months ago

People

(Reporter: tnikkel, Assigned: Nika)

Tracking

unspecified
mozilla48
Dependency tree / graph

Firefox Tracking Flags

(firefox48 fixed)

Details

Attachments

(1 attachment)

(Reporter)

Description

3 years ago
Bug 1214037 didn't seem to fix this problem for making DrawResult a must use type.

Here is one of many try pushes
https://treeherder.mozilla.org/#/jobs?repo=try&revision=d89631512db0

The code

  DrawResult result = SUCCESS;
  result &= FunctionReturnDrawResult();

always seems to get flagged as not using the value (in many places). Trivially changing it to

  DrawResult result = SUCCESS;
  DrawResult resul2 = FunctionReturnDrawResult();
  result = result & result2;

makes the error go away. However this code still triggers the error

  DrawResult result = SUCCESS;
  result = result & FunctionReturnDrawResult();
(Reporter)

Updated

3 years ago
Flags: needinfo?(michael)
Just chiming in: I too would really like to see this fixed. It let us prevent some important classes of errors that are definitely visible to our users as rendering issues.
(Assignee)

Updated

3 years ago
Depends on: 1255540
(Assignee)

Comment 2

3 years ago
Created attachment 8729701 [details] [diff] [review]
Ignore implicit Expr wrappers due to temporary cleanup in MUST_USE analysis

Turns out that these expressions contained temporaries, which meant that the expression was wrapped. With this patch those wrappers are now ignored.

Sorry for the delay, I'm in my last 3 weeks of class, and have remarkably little time to do this sort of stuff.

try: https://treeherder.mozilla.org/#/jobs?repo=try&revision=83f03890f8fd
Attachment #8729701 - Flags: review?(ehsan)
(Assignee)

Updated

3 years ago
Flags: needinfo?(michael)
(Assignee)

Updated

3 years ago
Assignee: nobody → michael

Updated

3 years ago
Attachment #8729701 - Flags: review?(ehsan) → review+

Comment 4

3 years ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/79af3a479ce9
Status: NEW → RESOLVED
Last Resolved: 3 years ago
status-firefox48: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla48
(Reporter)

Comment 5

3 years ago
Thanks!

Updated

7 months ago
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.