Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WTrackMenu: Add missing wcoverartlabel.h include #12924

Merged
merged 1 commit into from
Mar 5, 2024

Conversation

fwcd
Copy link
Member

@fwcd fwcd commented Mar 5, 2024

Ran into this issue with a debug Wasm build today:

In file included from mixxx/src/widget/wtrackmenu.cpp:1:
In file included from mixxx/src/widget/wtrackmenu.h:17:
mixxx/src/util/parented_ptr.h:37:32: error: static_cast from 'WCoverArtLabel *' to 'const QObject *', which are not related by inheritance, is not allowed
   37 |         DEBUG_ASSERT(!m_ptr || static_cast<const QObject*>(m_ptr)->parent());
      |                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
mixxx/src/util/assert.h:59:32: note: expanded from macro 'DEBUG_ASSERT'
   59 |         if (!static_cast<bool>(cond)) [[unlikely]] {                        \
      |                                ^~~~
mixxx/src/library/dlgtrackinfo.h:37:5: note: in instantiation of member function 'parented_ptr<WCoverArtLabel>::~parented_ptr' requested here
   37 |     ~DlgTrackInfo() override = default;
      |     ^
/opt/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/__memory/unique_ptr.h:300:7: note: in instantiation of member function 'std::default_delete<DlgTrackInfo>::operator()' requested here
  300 |       __ptr_.second()(__tmp);
      |       ^
/opt/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/__memory/unique_ptr.h:266:75: note: in instantiation of member function 'std::unique_ptr<DlgTrackInfo>::reset' requested here
  266 |   _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23 ~unique_ptr() { reset(); }
      |                                                                           ^
mixxx/src/widget/wtrackmenu.cpp:94:13: note: in instantiation of member function 'std::unique_ptr<DlgTrackInfo>::~unique_ptr' requested here
   94 | WTrackMenu::WTrackMenu(
      |             ^
mixxx/src/library/dlgtrackinfo.h:21:7: note: 'WCoverArtLabel' is incomplete
   21 | class WCoverArtLabel;
      |       ^
1 error generated.

Somehow DlgTrackInfo's parented_ptr<WCoverArtLabel> only ended up having the forward declaration in scope, resulting in the compiler complaining about WCoverArtLabel and QObject being seemingly unrelated types.

Including wcoverartlabel.h in wtrackmenu.cpp fixes it.

@fwcd fwcd added the wasm label Mar 5, 2024
@github-actions github-actions bot added the ui label Mar 5, 2024
Copy link
Member

@daschuer daschuer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you

@daschuer daschuer merged commit 5524ca0 into mixxxdj:main Mar 5, 2024
13 checks passed
@fwcd fwcd deleted the wcoverartlabel-include branch March 5, 2024 07:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants