+2019-02-06 Jonathan Wakely <jwakely@redhat.com>
+
+ PR libstdc++/89102 (partial)
+ * include/std/type_traits (common_type<>): Define.
+ (common_type<T>): Derive from common_type<T, T>.
+ * testsuite/20_util/common_type/requirements/explicit_instantiation.cc:
+ Test zero-length template argument list.
+ * testsuite/20_util/common_type/requirements/sfinae_friendly_1.cc:
+ Test additional single argument cases.
+ * testsuite/20_util/common_type/requirements/sfinae_friendly_2.cc:
+ Adjust expected error.
+
2019-02-05 Jonathan Wakely <jwakely@redhat.com>
PR libstdc++/89128
};
}
+static_assert(is_type<std::common_type<int>, int>(), "");
+static_assert(is_type<std::common_type<const int>, int>(), "");
static_assert(is_type<std::common_type<int, int>, int>(), "");
+static_assert(is_type<std::common_type<const int, int>, int>(), "");
static_assert(is_type<std::common_type<ScEn, ScEn>, ScEn>(), "");
static_assert(is_type<std::common_type<UnscEn, UnscEn>, UnscEn>(), "");
static_assert(is_type<std::common_type<UnscEn, int>, int>(), "");
const volatile int*>(), "");
static_assert(is_type<std::common_type<void*, const volatile int*>,
const volatile void*>(), "");
+static_assert(is_type<std::common_type<void>, void>(), "");
+static_assert(is_type<std::common_type<const void>, void>(), "");
static_assert(is_type<std::common_type<void, void>, void>(), "");
static_assert(is_type<std::common_type<const void, const void>, void>(), "");
static_assert(is_type<std::common_type<int&, int&&>, int>(), "");
static_assert(!has_type<std::common_type<std::initializer_list<int>,
std::initializer_list<long>>>(), "");
+// PR libstdc++/89102
+static_assert(!has_type<std::common_type<int() &>>(), "");
+static_assert(!has_type<std::common_type<int() & noexcept>>(), "");
+static_assert(!has_type<std::common_type<int() const>>(), "");
+static_assert(!has_type<std::common_type<int(...) &>>(), "");
+static_assert(!has_type<std::common_type<int(...) & noexcept>>(), "");
+static_assert(!has_type<std::common_type<int(...) const>>(), "");
+
void test(int i)
{
auto local_lmd1 = [=](int, double) { return i + i; };