MOZ_MUST_USE treats expressions evaluating to lvalue references as MUST_USE

RESOLVED FIXED in Firefox 48

Status

defect
RESOLVED FIXED
3 years ago
Last year

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.
Depends on: 1255540
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)
Flags: needinfo?(michael)
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
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla48
Reporter

Comment 5

3 years ago
Thanks!

Updated

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