// Primary template.
/// make_unsigned
template<typename _Tp>
-#if __cpp_concepts
- requires is_integral<_Tp>::value || __is_enum(_Tp)
-#endif
struct make_unsigned
{ typedef typename __make_unsigned_selector<_Tp>::__type type; };
// Primary template.
/// make_signed
template<typename _Tp>
-#if __cpp_concepts
- requires is_integral<_Tp>::value || __is_enum(_Tp)
-#endif
struct make_signed
{ typedef typename __make_signed_selector<_Tp>::__type type; };
using T8 = make_signed<float>::type; // { dg-error "here" }
}
-// { dg-error "invalid use of incomplete type" "" { target c++17_down } 0 }
-// { dg-error "constraint failure" "" { target c++20 } 0 }
+// { dg-error "invalid use of incomplete type" "" { target *-*-* } 0 }
--- /dev/null
+// { dg-do compile { target c++11 } }
+#include <type_traits>
+
+// Check that we can name invalid specializations, just don't instantiate them.
+
+using X = std::make_signed<float>;
+using Y = std::make_signed<bool>;
+using Z = std::make_signed<void>;
using T8 = make_unsigned<float>::type; // { dg-error "here" }
}
-// { dg-error "invalid use of incomplete type" "" { target c++17_down } 0 }
-// { dg-error "constraint failure" "" { target c++20 } 0 }
+// { dg-error "invalid use of incomplete type" "" { target *-*-* } 0 }
--- /dev/null
+// { dg-do compile { target c++11 } }
+#include <type_traits>
+
+// Check that we can name invalid specializations, just don't instantiate them.
+
+using X = std::make_unsigned<float>;
+using Y = std::make_unsigned<bool>;
+using Z = std::make_unsigned<void>;
C c;
std::ssize(c); // { dg-error "no matching function" }
}
-// { dg-error "incomplete type .*make_signed.*S" "" { target c++17_down } 0 }
-// { dg-error "constraint failure" "" { target c++20 } 0 }
+// { dg-error "incomplete type .*make_signed.*S" "" { target *-*-* } 0 }