Closed Bug 1527881 Opened 5 years ago Closed 5 years ago

no matching function for call to 'forward' in Rooted<GCVector<T>>::emplaceBack

Categories

(Core :: JavaScript: GC, defect, P3)

defect

Tracking

()

RESOLVED FIXED
mozilla67
Tracking Status
firefox67 --- fixed

People

(Reporter: allstars.chh, Assigned: allstars.chh)

Details

Attachments

(1 file)

class Foo {
public:
Foo(int, int) {}
};
Rooted<GCVector<Foo>> vec(cx, GCVector<Foo>(cx));
cx.emplaceBack(1, 2); // this line throws compilation error

3:50.44 /home/allstars/src/emplaceback/obj-x86_64-pc-linux-gnu/dist/include/js/GCVector.h:230:30: error: no matching function for call to 'forward'
3:50.44 return vec().emplaceBack(std::forward<Args...>(aArgs...));
3:50.44 ^~~~~~~~~~~~~~~~~~~~~

3:50.44 /usr/bin/../lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/c++/7.3.0/bits/move.h:73:5: note: candidate function template not viable: requires single argument '__t', but 2 arguments were provided
3:50.44 forward(typename std::remove_reference<_Tp>::type& __t) noexcept
3:50.44 ^
3:50.44 /usr/bin/../lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/c++/7.3.0/bits/move.h:84:5: note: candidate function template not viable: requires single argument '__t', but 2 arguments were provided
3:50.45 forward(typename std::remove_reference<_Tp>::type&& __t) noexcept
3:50.45 ^
3:50.45 1 error generated.

Comment on attachment 9043911 [details] [diff] [review]
Patch

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

Wow. Uh, I wish I really understood this weird template syntax.
Attachment #9043911 - Flags: review?(sphink) → review+
Pushed by allstars.chh@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/259550ac3b56
fix compilation error in Rooted<GCVector<T>>::emplaceBack. r=sfink
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla67
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: