Closed
Bug 1203314
Opened 9 years ago
Closed 9 years ago
Make operator<< a method on unused_t
Categories
(Core :: MFBT, defect)
Core
MFBT
Tracking
()
RESOLVED
FIXED
mozilla43
Tracking | Status | |
---|---|---|
firefox43 | --- | fixed |
People
(Reporter: mccr8, Assigned: mccr8)
Details
Attachments
(1 file)
849 bytes,
patch
|
froydnj
:
review+
|
Details | Diff | Splinter Review |
If you include mozilla/unused.h in a file that also includes Chromium IPC logging, then operator overload resolution somehow decides that the << from unused is the right one. Making operator<< a method on unused_t rather than a free-floating function fixes this problem.
Assignee | ||
Comment 1•9 years ago
|
||
This prevents operator overload resolution from failing when this file is included in a file that uses Chromium IPC logging.
Attachment #8659463 -
Flags: review?(nfroyd)
Updated•9 years ago
|
Attachment #8659463 -
Flags: review?(nfroyd) → review+
Assignee | ||
Updated•9 years ago
|
Keywords: checkin-needed
Comment 3•9 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/f04c038de236
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla43
Comment 4•9 years ago
|
||
(In reply to Andrew McCreight [:mccr8] from comment #0) > If you include mozilla/unused.h in a file that also includes Chromium IPC > logging, then operator overload resolution somehow decides that the << from > unused is the right one. Before this patch, mfbt/unused.h defined ::mozilla::operator<< and ipc/chromium/src/base/logging.h defined ::operator<<. So, when you << to a ::mozilla::Logger&, the compiler looks in namespace ::mozilla (argument-dependent lookup), sees only definitions that don't match the provided types, and complains. Arguably it's the IPC header that's wrong, but it's a moot point now (until the next time someone defines ::mozilla::operator<< and it comes into contact with IPC).
You need to log in
before you can comment on or make changes to this bug.
Description
•