Closed Bug 1486512 Opened 6 years ago Closed 6 years ago

MSVC cannot compile Promise-inl.h

Categories

(Core :: DOM: Core & HTML, defect)

All
Windows
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla63
Tracking Status
firefox63 --- fixed

People

(Reporter: froydnj, Assigned: kmag)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

We get:

 0:38.67 c:\mozilla-central\obj-aarch64-windows-mingw32\dist\include\mozilla/dom/Promise-inl.h(142): error C2244: 'mozilla::dom::Promise::ThenWithCycleCollectedArgs': unable to match function definition to an existing declaration
 0:38.67 c:\mozilla-central\obj-aarch64-windows-mingw32\dist\include\mozilla/dom/Promise-inl.h(141): note: see declaration of 'mozilla::dom::Promise::ThenWithCycleCollectedArgs'
 0:38.67 c:\mozilla-central\obj-aarch64-windows-mingw32\dist\include\mozilla/dom/Promise-inl.h(142): note: definition
 0:38.67 c:\mozilla-central\obj-aarch64-windows-mingw32\dist\include\mozilla/dom/Promise-inl.h(142): note: 'EnableIf<IsHandlerCallback<Callback,Args...>::value,mozilla::Result<RefPtr<mozilla::dom::Promise>,nsresult>>::Type mozilla::dom::Promise::ThenWithCycleCollectedArgs(Callback &&,Args &&...)'
 0:38.67 c:\mozilla-central\obj-aarch64-windows-mingw32\dist\include\mozilla/dom/Promise-inl.h(142): note: existing declarations
 0:38.67 c:\mozilla-central\obj-aarch64-windows-mingw32\dist\include\mozilla/dom/Promise-inl.h(142): note: 'EnableIf<mozilla::IsSame<already_AddRefed<mozilla::dom::Promise>,unknown-type>::value,mozilla::Result<RefPtr<mozilla::dom::Promise>,nsresult>>::Type mozilla::dom::Promise::ThenWithCycleCollectedArgs(Callback &&,Args &&...)'

Kris, I think you said you were going to take a look at this?  This is going to make compiling for AArch64 Windows with MSVC somewhat difficult... ;)
Flags: needinfo?(kmaglione+bmo)
I reported a bug:

https://developercommunity.visualstudio.com/content/problem/322017/unable-to-match-function-definition-to-an-existing-1.html

I'm not super-expectant that it's going to get fixed, though.
Compiling with clang appears to be blocked on https://bugs.llvm.org/show_bug.cgi?id=38726
(In reply to Nathan Froyd [:froydnj] from comment #0)
> Kris, I think you said you were going to take a look at this?

I did, but that was less than 24 hours ago, on a Sunday :P

> This is going to make compiling for AArch64 Windows with MSVC somewhat
> difficult... ;)

Urgh. Are we using MSVC for that?
Flags: needinfo?(kmaglione+bmo)
Assignee: nobody → kmaglione+bmo
(In reply to Kris Maglione [:kmag] from comment #3)
> (In reply to Nathan Froyd [:froydnj] from comment #0)
> > Kris, I think you said you were going to take a look at this?
> 
> I did, but that was less than 24 hours ago, on a Sunday :P

Heh, fair enough. :)

> > This is going to make compiling for AArch64 Windows with MSVC somewhat
> > difficult... ;)
> 
> Urgh. Are we using MSVC for that?

At the moment, yes.
For reasions which are unclear, MSVC does not recognize the declaration and
definition of ThenWithCycleCollectedArts as matching in their previous form.
Changing both to use the same template `using` declaration for the entire
return type fixes this.

MSVC also has problems with the previous use of std::forward, which is fixed
by explicitly coercing smart pointers to their equivalent pointer types, and
moving any other type.
Comment on attachment 9004390 [details]
Bug 1486512: Fix compiling Promise-inl.h on MSVC. r=froydnj

Nathan Froyd [:froydnj] has approved the revision.
Attachment #9004390 - Flags: review+
https://hg.mozilla.org/mozilla-central/rev/23e112bfaf97
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla63
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: