https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124246

            Bug ID: 124246
           Summary: [reflection] is_swappable_type doesn't work with
                    std::priority_queue
           Product: gcc
           Version: 16.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mpolacek at gcc dot gnu.org
  Target Milestone: ---

(This problem is tested in type_trait13.C.)

```
#include <meta>
#include <queue>

//static_assert (std::is_swappable_v<std::priority_queue <int>>);
static_assert (std::meta::is_swappable_type (^^std::priority_queue <int>));
```

should work but produces:

In file included from
/home/mpolacek/x/trunk/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/basic_string.h:41,
                 from
/home/mpolacek/x/trunk/x86_64-pc-linux-gnu/libstdc++-v3/include/string:58,
                 from
/home/mpolacek/x/trunk/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/stdexcept_throw.h:57,
                 from
/home/mpolacek/x/trunk/x86_64-pc-linux-gnu/libstdc++-v3/include/array:44,
                 from
/home/mpolacek/x/trunk/x86_64-pc-linux-gnu/libstdc++-v3/include/meta:42,
                 from type_trait13.C:1:
/home/mpolacek/x/trunk/x86_64-pc-linux-gnu/libstdc++-v3/include/ext/alloc_traits.h:
In instantiation of ‘struct __gnu_cxx::__alloc_traits<std::allocator<int>,
int>’:
/home/mpolacek/x/trunk/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/stl_vector.h:94:21:
  required from ‘struct std::_Vector_base<int, std::allocator<int> >’
   94 |         rebind<_Tp>::other _Tp_alloc_type;
      |                            ^~~~~~~~~~~~~~
/home/mpolacek/x/trunk/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/stl_vector.h:460:11:
  required from ‘class std::vector<int, std::allocator<int> >’
  460 |     class vector : protected _Vector_base<_Tp, _Alloc>
      |           ^~~~~~
type_trait13.C:5:72:   required from here
    5 | static_assert (std::meta::is_swappable_type (^^std::priority_queue
<int>));
      |                                                                       
^
/home/mpolacek/x/trunk/x86_64-pc-linux-gnu/libstdc++-v3/include/ext/alloc_traits.h:71:13:
error: ‘template<class _Ptr, class ... _Args> static constexpr
std::__enable_if_t<((bool)std::__and_<std::is_same<typename
std::allocator_traits<_Alloc>::pointer, _Ptr>,
std::__not_<std::is_pointer<_Ptr> > >::value)>
__gnu_cxx::__alloc_traits<_Alloc, <template-parameter-1-2>
>::construct(_Alloc&, _Ptr, _Args&& ...) [with _Args = _Ptr; _Alloc =
std::allocator<int>; <template-parameter-1-2> = int]’ conflicts with a previous
declaration
   71 |       using __is_custom_pointer
      |             ^~~~~~~~~~~~~~~~~~~
/home/mpolacek/x/trunk/x86_64-pc-linux-gnu/libstdc++-v3/include/ext/alloc_traits.h:65:23:
note: previous declaration ‘using
__gnu_cxx::__alloc_traits<std::allocator<int>, int>::_Base_type::construct’
   65 |     using _Base_type::construct;
      |                       ^~~~~~~~~
/home/mpolacek/x/trunk/x86_64-pc-linux-gnu/libstdc++-v3/include/ext/alloc_traits.h:71:13:
error: ‘template<class _Ptr> static constexpr
std::__enable_if_t<((bool)std::__and_<std::is_same<typename
std::allocator_traits<_Alloc>::pointer, _Ptr>,
std::__not_<std::is_pointer<_Ptr> > >::value)>
__gnu_cxx::__alloc_traits<_Alloc, <template-parameter-1-2> >::destroy(_Alloc&,
_Ptr) [with _Alloc = std::allocator<int>; <template-parameter-1-2> = int]’
conflicts with a previous declaration
   71 |       using __is_custom_pointer
      |             ^~~~~~~~~~~~~~~~~~~
/home/mpolacek/x/trunk/x86_64-pc-linux-gnu/libstdc++-v3/include/ext/alloc_traits.h:66:23:
note: previous declaration ‘using
__gnu_cxx::__alloc_traits<std::allocator<int>, int>::_Base_type::destroy’
   66 |     using _Base_type::destroy;
      |                       ^~~~~~~
In file included from
/home/mpolacek/x/trunk/x86_64-pc-linux-gnu/libstdc++-v3/include/vector:68,
                 from
/home/mpolacek/x/trunk/x86_64-pc-linux-gnu/libstdc++-v3/include/meta:49:
/home/mpolacek/x/trunk/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/stl_vector.h:
In instantiation of ‘class std::vector<int, std::allocator<int> >’:
type_trait13.C:5:72:   required from here
    5 | static_assert (std::meta::is_swappable_type (^^std::priority_queue
<int>));
      |                                                                       
^
/home/mpolacek/x/trunk/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/stl_vector.h:540:20:
error: ‘std::vector<int, std::allocator<int> >::_Base::_M_impl’ invalid in
‘class std::vector<int, std::allocator<int> >’ because of local member ‘using
std::vector<int, std::allocator<int> >::_Base::_M_impl’ with same name
  540 |       using _Base::_M_impl;
      |                    ^~~~~~~
/home/mpolacek/x/trunk/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/stl_vector.h:540:20:
note: local member ‘using std::vector<int, std::allocator<int>
>::_Base::_M_impl’ declared here

Reply via email to