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

--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
It affects other containers too:

#include <vector>
#include <forward_list>
#include <list>

template <typename T>
struct Alloc
{
  using value_type = T;

  T* allocate(unsigned n);  
  void deallocate(T* p, unsigned n);

  Alloc(int) { }

  template<typename U>
    Alloc(const Alloc<U>&) { }
};

template<typename T, typename U>
  bool operator==(Alloc<T>, Alloc<U>) { return true; }
template<typename T, typename U>
  bool operator!=(Alloc<T>, Alloc<U>) { return false; }

constexpr bool b
  = std::is_default_constructible<std::vector<int, Alloc<int>>>::value;
constexpr bool c
  = std::is_default_constructible<std::vector<bool, Alloc<bool>>>::value;
constexpr bool d
  = std::is_default_constructible<std::forward_list<bool, Alloc<bool>>>::value;
constexpr bool e
  = std::is_default_constructible<std::list<bool, Alloc<bool>>>::value;

Reply via email to