Closed Bug 1315624 Opened 3 years ago Closed 3 years ago

Delete operator|| and operator&& for CastableTypedEnumResult

Categories

(Core :: MFBT, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla53
Tracking Status
firefox53 --- fixed

People

(Reporter: TYLin, Assigned: TYLin)

Details

Attachments

(1 file)

We should delete operator|| and operator&& for CastableTypedEnumResult [1]. Defining these two operators destroy short-circuit evaluation. This leads to a real assert in [2] where PropHasFlags() is evaluated even if (aEnabled & EnabledState::eInUASheets) is false when "layout.css.prefixes.webkit" is set to false on Nightly.

BTW, "More Effective C++ Item 7" recommended never overloading these two operator as well. 

[1] http://searchfox.org/mozilla-central/rev/f5c9e9a249637c9abd88754c8963ecb3838475cb/mfbt/TypedEnumBits.h#89-90
[2] http://searchfox.org/mozilla-central/rev/f5c9e9a249637c9abd88754c8963ecb3838475cb/layout/style/nsCSSProps.h#659
Attachment #8808092 - Flags: review?(jwalden+bmo) → review?(nfroyd)
Comment on attachment 8808092 [details]
Bug 1315624 - Delete operator&& and operator|| for CastableTypedEnumResult.

https://reviewboard.mozilla.org/r/91022/#review92810

Thank you for writing tests!
Attachment #8808092 - Flags: review?(nfroyd) → review+
Pushed by tlin@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/0dfe466e790f
Delete operator&& and operator|| for CastableTypedEnumResult. r=froydnj
https://hg.mozilla.org/mozilla-central/rev/0dfe466e790f
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla53
You need to log in before you can comment on or make changes to this bug.