2018-07-24 Jonathan Wakely <jwakely@redhat.com>
+ * include/bits/uses_allocator.h (__is_erased_or_convertible): Reorder
+ conditions. Add comments.
+ * testsuite/20_util/uses_allocator/69293_neg.cc: Adjust dg-error line.
+ * testsuite/20_util/uses_allocator/cons_neg.cc: Likewise.
+ * testsuite/20_util/scoped_allocator/69293_neg.cc: Likewise.
+
+ * include/bits/uses_allocator.h (__is_erased_or_convertible): Remove.
+ (__uses_allocator_helper): Check conditions directly instead of
+ using __is_erased_or_convertible.
+
* include/experimental/memory_resource: Adjust comments and
whitespace.
(__resource_adaptor_imp): Add second template parameter for type of
{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
+ // This is used for std::experimental::erased_type from Library Fundamentals.
struct __erased_type { };
+ // This also supports the "type-erased allocator" protocol from the
+ // Library Fundamentals TS, where allocator_type is erased_type.
+ // The second condition will always be false for types not using the TS.
template<typename _Alloc, typename _Tp>
using __is_erased_or_convertible
- = __or_<is_same<_Tp, __erased_type>, is_convertible<_Alloc, _Tp>>;
+ = __or_<is_convertible<_Alloc, _Tp>, is_same<_Tp, __erased_type>>;
/// [allocator.tag]
struct allocator_arg_t { explicit allocator_arg_t() = default; };
scoped_alloc sa;
auto p = sa.allocate(1);
sa.construct(p); // this is required to be ill-formed
- // { dg-error "static assertion failed" "" { target *-*-* } 90 }
+ // { dg-error "static assertion failed" "" { target *-*-* } 94 }
}
{
alloc_type a;
std::tuple<X> t(std::allocator_arg, a); // this is required to be ill-formed
- // { dg-error "static assertion failed" "" { target *-*-* } 90 }
+ // { dg-error "static assertion failed" "" { target *-*-* } 94 }
}
tuple<Type> t(allocator_arg, a, 1);
}
-// { dg-error "static assertion failed" "" { target *-*-* } 90 }
+// { dg-error "static assertion failed" "" { target *-*-* } 94 }