We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 54194e1 commit 7804824Copy full SHA for 7804824
libcxx/test/std/numerics/c.math/signbit.pass.cpp
@@ -70,9 +70,22 @@ struct TestInt {
70
}
71
};
72
73
+template <typename T>
74
+struct ConvertibleTo {
75
+ operator T() const { return T(); }
76
+};
77
+
78
int main(int, char**) {
79
types::for_each(types::floating_point_types(), TestFloat());
80
types::for_each(types::integral_types(), TestInt());
81
82
+ // Make sure we can call `std::signbit` with convertible types. This checks
83
+ // whether overloads for all cv-unqualified floating-point types are working
84
+ // as expected.
85
+ {
86
+ assert(!std::signbit(ConvertibleTo<float>()));
87
+ assert(!std::signbit(ConvertibleTo<double>()));
88
+ assert(!std::signbit(ConvertibleTo<long double>()));
89
+ }
90
return 0;
91
0 commit comments