Closed Bug 1698697 Opened 4 years ago Closed 4 years ago

error: call to implicitly-deleted copy constructor of 'mozilla::BlockingResourceBase::AcquisitionState'

Categories

(Core :: XPCOM, defect)

defect

Tracking

()

RESOLVED FIXED
88 Branch
Tracking Status
firefox-esr78 --- wontfix
firefox86 --- wontfix
firefox87 --- wontfix
firefox88 --- fixed

People

(Reporter: glandium, Assigned: glandium)

References

(Regression)

Details

(Keywords: regression)

Attachments

(1 file)

When enabling callstack tracking in BlockingResourceBase.h, the build fails with:

In file included from /tmp/central/xpcom/threads/IdleTaskRunner.cpp:7:
In file included from /tmp/central/xpcom/threads/IdleTaskRunner.h:12:
In file included from /tmp/central/xpcom/threads/nsThreadUtils.h:14:
In file included from /tmp/central/obj-x86_64-pc-linux-gnu/dist/include/mozilla/EventQueue.h:10:
In file included from /tmp/central/obj-x86_64-pc-linux-gnu/dist/include/mozilla/Mutex.h:10:
/tmp/central/obj-x86_64-pc-linux-gnu/dist/include/mozilla/BlockingResourceBase.h:201:51: error: call to implicitly-deleted copy constructor of 'mozilla::BlockingResourceBase::AcquisitionState' (aka 'Maybe<AutoTArray<void *, kAcquisitionStateStackSize>>')
  AcquisitionState GetAcquisitionState() { return mAcquired; }
                                                  ^~~~~~~~~
/tmp/central/obj-x86_64-pc-linux-gnu/dist/include/mozilla/Maybe.h:376:7: note: copy constructor of 'Maybe<AutoTArray<void *, 24>>' is implicitly deleted because base class 'detail::Maybe_CopyMove_Enabler<AutoTArray<void *, 24>>' has a deleted copy constructor
      public detail::Maybe_CopyMove_Enabler<T> {
      ^
/tmp/central/obj-x86_64-pc-linux-gnu/dist/include/mozilla/Maybe.h:209:3: note: copy constructor is implicitly deleted because 'Maybe_CopyMove_Enabler<AutoTArray<void *, 24>, false, false, true>' has a user-declared move constructor
  MOZ_MAYBE_MOVE_OPS()
  ^
/tmp/central/obj-x86_64-pc-linux-gnu/dist/include/mozilla/Maybe.h:131:13: note: expanded from macro 'MOZ_MAYBE_MOVE_OPS'
  constexpr Maybe_CopyMove_Enabler(Maybe_CopyMove_Enabler&& aOther) {   \
            ^
In file included from /tmp/central/xpcom/threads/IdleTaskRunner.cpp:7:
In file included from /tmp/central/xpcom/threads/IdleTaskRunner.h:12:
In file included from /tmp/central/xpcom/threads/nsThreadUtils.h:14:
In file included from /tmp/central/obj-x86_64-pc-linux-gnu/dist/include/mozilla/EventQueue.h:10:
In file included from /tmp/central/obj-x86_64-pc-linux-gnu/dist/include/mozilla/Mutex.h:10:
/tmp/central/obj-x86_64-pc-linux-gnu/dist/include/mozilla/BlockingResourceBase.h:210:15: error: object of type 'mozilla::BlockingResourceBase::AcquisitionState' (aka 'Maybe<AutoTArray<void *, kAcquisitionStateStackSize>>') cannot be assigned because its copy assignment operator is implicitly deleted
    mAcquired = aAcquisitionState;
              ^
/tmp/central/obj-x86_64-pc-linux-gnu/dist/include/mozilla/Maybe.h:376:7: note: copy assignment operator of 'Maybe<AutoTArray<void *, 24>>' is implicitly deleted because base class 'detail::Maybe_CopyMove_Enabler<AutoTArray<void *, 24>>' has a deleted copy assignment operator
      public detail::Maybe_CopyMove_Enabler<T> {
      ^
/tmp/central/obj-x86_64-pc-linux-gnu/dist/include/mozilla/Maybe.h:209:3: note: copy assignment operator is implicitly deleted because 'Maybe_CopyMove_Enabler<AutoTArray<void *, 24>, false, false, true>' has a user-declared move constructor
  MOZ_MAYBE_MOVE_OPS()
  ^
/tmp/central/obj-x86_64-pc-linux-gnu/dist/include/mozilla/Maybe.h:131:13: note: expanded from macro 'MOZ_MAYBE_MOVE_OPS'
  constexpr Maybe_CopyMove_Enabler(Maybe_CopyMove_Enabler&& aOther) {   \
            ^
2 errors generated.

Since GetAcquisitionState is never used independently of
ClearAcquisitionState, we change it to TakeAcquisitionState, such that
we don't require an expensive array copy in this case.

Pushed by mh@glandium.org: https://hg.mozilla.org/integration/autoland/rev/78e705fb75a3 Fix BlockingResourceBase code with callstack tracking enabled. r=nika
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 88 Branch
Has Regression Range: --- → yes
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: