Skip to content

Warning GCC13 on polymorphic_allocator destroy #38

@XRay3D

Description

@XRay3D

talloc.destroy(ptr);

:404:17:   required from ‘std::unique_ptr<_Tp, _Dp>::~unique_ptr() [with _Tp = {anonymous}::Bar; _Dp = {anonymous}::polymorphic_allocator_delete]’
/home/x-ray/projects/qt/cpp-masters/smartptrs/sankels_complete.cc:97:11:   required from here
/home/x-ray/projects/qt/cpp-masters/smartptrs/sankels_complete.cc:84:19: warning: ‘void std::pmr::polymorphic_allocator<_Tp>::destroy(_Up*) [with _Up = {anonymous}::Bar; _Tp = {anonymous}::Bar]’ is deprecated: use 'allocator_traits::destroy' instead [-Wdeprecated-declarations]
   84 |     talloc.destroy(ptr);
      |     ~~~~~~~~~~~~~~^~~~~

Possible fix:

std::destroy_at(ptr);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions