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

GCC 14: warning about not using 'boost::archive::class_id_type::operator base_type&()' #326

Open
smuzaffar opened this issue Feb 22, 2025 · 0 comments

Comments

@smuzaffar
Copy link

smuzaffar commented Feb 22, 2025

Hi,
We have a generic load routine for all types that feature conversion operators. Compiling this code with GCC 14 warns that compiler is not using the conversion operators [a]. Was there any specific reason to make base_type of these classes (which provide conversion operator[b]) private? If base_type is public then we could do something like

load(static_cast<T::base_type &>(t));

[a]

portable_iarchive.hpp#L412:12: warning: casting 'boost::archive::class_id_type' to 'boost::uint_t<16>::least&' {aka 'short unsigned int&'} does not use 'boost::archive::class_id_type::operator base_type&()' [-Wcast-user-defined]
   412 |       load((typename boost::uint_t<sizeof(T) * CHAR_BIT>::least&)(t));

[b]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant