Add __multiple_inheritance specifier to HttpChannelChild to allow building with clang-cl

RESOLVED WONTFIX

Status

()

Core
Networking
RESOLVED WONTFIX
4 years ago
4 years ago

People

(Reporter: jrmuizel, Assigned: jrmuizel)

Tracking

(Blocks: 1 bug)

unspecified
mozilla33
x86
Mac OS X
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

4 years ago
Created attachment 8437433 [details] [diff] [review]
Add __multiple_inheritance specifier to HttpChannelChild to allow building with clang-cl

This is needed until http://llvm.org/PR19987 is fixed
(Assignee)

Updated

4 years ago
Blocks: 752004

Updated

4 years ago
Attachment #8437433 - Flags: review?(jduell.mcbugs)
Comment on attachment 8437433 [details] [diff] [review]
Add __multiple_inheritance specifier to HttpChannelChild to allow building with clang-cl

Review of attachment 8437433 [details] [diff] [review]:
-----------------------------------------------------------------

What kinda crappy C++ compiler needs to be told it's gonna do multiple inheritance?  :)

I'm trusting Ehsan on this one...
Attachment #8437433 - Flags: review?(jduell.mcbugs) → review+

Comment 2

4 years ago
This is basically a clang-cl bug which gets confused and thinks that this class has __single_inheritance set on it (see the link in comment 0).  We'll remove this code when that bug gets fixed.  :-)

And it seems like Jeff landed this (by mistake?!) as part of http://hg.mozilla.org/mozilla-central/rev/e19324807568.
Assignee: nobody → jmuizelaar
Status: NEW → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla33

Comment 3

4 years ago
Backed out because the upstream bug was fixed: https://hg.mozilla.org/integration/mozilla-inbound/rev/f638a025d9eb
Resolution: FIXED → WONTFIX

Comment 4

4 years ago
(In reply to Jason Duell from comment #1)
> What kinda crappy C++ compiler needs to be told it's gonna do multiple
> inheritance?  :)

The root cause of this is that a) nsHttpAsyncAborter<T> is being compiled as part of T's definition, so that the type of T is incomplete at this point b) nsHttpAsyncAborter contains a pointer to member function of T, so that MSVC is forced to use its worse-case function pointer type, which is 16 bytes* long. (If T was complete at this point, MSVC would be able to use an 8 byte member function pointer.)

The only way to get MSVC to compile an 8 byte member function pointer here is to use the __multiple_inheritance specifier. (There are pragmas and command line arguments to set the member function pointer size but they affect all member function pointers, not just pointers to unknown types.)

*When compiling for 32 bits; I don't know the rules for 64 bit MSVC, but I think they're 4 bytes bigger.
You need to log in before you can comment on or make changes to this bug.