* include/bits/uses_allocator.h (uses_allocator_v): New.
* include/std/functional (is_bind_expression_v, is_placeholder_v):
Likewise.
* testsuite/20_util/bind/is_placeholder_v.cc: Likewise.
* testsuite/20_util/declval/requirements/1_neg.cc: Adjust.
* testsuite/20_util/duration/literals/range.cc: Likewise.
* testsuite/20_util/duration/requirements/typedefs_neg1.cc: Likewise.
* testsuite/20_util/duration/requirements/typedefs_neg2.cc: Likewise.
* testsuite/20_util/duration/requirements/typedefs_neg3.cc: Likewise.
* testsuite/20_util/make_signed/requirements/typedefs_neg.cc: Likewise.
* testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc:
Likewise.
* testsuite/20_util/ratio/operations/ops_overflow_neg.cc: Likewise.
* testsuite/20_util/uses_allocator/requirements/uses_allocator_v.cc:
New.
From-SVN: r238921
+2016-07-31 Ville Voutilainen <ville.voutilainen@gmail.com>
+
+ Add missing variable traits, fix testsuite failures.
+ * include/bits/uses_allocator.h (uses_allocator_v): New.
+ * include/std/functional (is_bind_expression_v, is_placeholder_v):
+ Likewise.
+ * testsuite/20_util/bind/is_placeholder_v.cc: Likewise.
+ * testsuite/20_util/declval/requirements/1_neg.cc: Adjust.
+ * testsuite/20_util/duration/literals/range.cc: Likewise.
+ * testsuite/20_util/duration/requirements/typedefs_neg1.cc: Likewise.
+ * testsuite/20_util/duration/requirements/typedefs_neg2.cc: Likewise.
+ * testsuite/20_util/duration/requirements/typedefs_neg3.cc: Likewise.
+ * testsuite/20_util/make_signed/requirements/typedefs_neg.cc: Likewise.
+ * testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc:
+ Likewise.
+ * testsuite/20_util/ratio/operations/ops_overflow_neg.cc: Likewise.
+ * testsuite/20_util/uses_allocator/requirements/uses_allocator_v.cc:
+ New.
+
2016-07-31 Jonathan Wakely <jwakely@redhat.com>
* testsuite/18_support/numeric_limits/40856.cc [__STRICT_ANSI__]: Do
__ret._M_a = std::__addressof(__a);
return __ret;
}
+#if __cplusplus > 201402L
+ template <typename _Tp, typename _Alloc>
+ constexpr bool uses_allocator_v = uses_allocator<_Tp, _Alloc>::value;
+#endif // C++17
_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std
: public integral_constant<int, 0>
{ };
+#if __cplusplus > 201402L
+ template <typename _Tp> constexpr bool is_bind_expression_v
+ = is_bind_expression<_Tp>::value;
+ template <typename _Tp> constexpr int is_placeholder_v
+ = is_placeholder<_Tp>::value;
+#endif // C++17
+
/** @brief The type of placeholder objects defined by libstdc++.
* @ingroup binders
*/
--- /dev/null
+// { dg-options "-std=gnu++17" }
+// { dg-do compile }
+
+// Copyright (C) 2016 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a moved_to of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+#include <functional>
+
+struct X
+{
+ int operator()() const { return 0; }
+ int operator()() volatile { return 1; }
+ int operator()() const volatile { return 2; }
+ void operator()() { };
+};
+
+static_assert( std::is_placeholder<decltype(std::placeholders::_1)>::value
+ == std::is_placeholder_v<decltype(std::placeholders::_1)>);
+
+const auto b0 = std::bind(X());
+static_assert( std::is_bind_expression<decltype(b0)>::value
+ == std::is_bind_expression_v<decltype(b0)>);
+
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
-// { dg-error "static assertion failed" "" { target *-*-* } 2259 }
+// { dg-error "static assertion failed" "" { target *-*-* } 2272 }
#include <utility>
// std::numeric_limits<int64_t>::max() == 9223372036854775807;
auto h = 9223372036854775808h;
- // { dg-error "cannot be represented" "" { target *-*-* } 796 }
+ // { dg-error "cannot be represented" "" { target *-*-* } 800 }
}
test_type d;
}
-// { dg-error "rep cannot be a duration" "" { target *-*-* } 246 }
+// { dg-error "rep cannot be a duration" "" { target *-*-* } 250 }
// { dg-error "required from here" "" { target *-*-* } 31 }
test_type d; // { dg-error "required from here" }
}
-// { dg-error "must be a specialization of ratio" "" { target *-*-* } 247 }
+// { dg-error "must be a specialization of ratio" "" { target *-*-* } 251 }
// { dg-prune-output "not a member" }
test_type d;
}
-// { dg-error "period must be positive" "" { target *-*-* } 249 }
+// { dg-error "period must be positive" "" { target *-*-* } 253 }
// { dg-error "required from here" "" { target *-*-* } 33 }
// { dg-error "required from here" "" { target *-*-* } 40 }
// { dg-error "required from here" "" { target *-*-* } 42 }
-// { dg-error "invalid use of incomplete type" "" { target *-*-* } 1924 }
+// { dg-error "invalid use of incomplete type" "" { target *-*-* } 1937 }
// { dg-error "required from here" "" { target *-*-* } 40 }
// { dg-error "required from here" "" { target *-*-* } 42 }
-// { dg-error "invalid use of incomplete type" "" { target *-*-* } 1820 }
-// { dg-error "declaration of" "" { target *-*-* } 1777 }
+// { dg-error "invalid use of incomplete type" "" { target *-*-* } 1833 }
+// { dg-error "declaration of" "" { target *-*-* } 1790 }
// { dg-error "required from here" "" { target *-*-* } 29 }
// { dg-error "expected initializer" "" { target *-*-* } 36 }
// { dg-error "expected initializer" "" { target *-*-* } 38 }
-// { dg-error "overflow in addition" "" { target *-*-* } 435 }
+// { dg-error "overflow in addition" "" { target *-*-* } 451 }
// { dg-error "overflow in multiplication" "" { target *-*-* } 97 }
// { dg-error "overflow in multiplication" "" { target *-*-* } 99 }
// { dg-error "overflow in multiplication" "" { target *-*-* } 101 }
--- /dev/null
+// { dg-options "-std=gnu++17" }
+// { dg-do compile }
+
+// Copyright (C) 2016 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a moved_to of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+#include <memory>
+#include <string>
+
+using namespace std;
+
+static_assert(uses_allocator<int, allocator<int>>::value
+ == uses_allocator_v<int, allocator<int>>);
+static_assert(uses_allocator<string, allocator<string>>::value
+ == uses_allocator_v<string, allocator<string>>);