Skip to content

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

@smuzaffar

Description

@smuzaffar

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]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions