Skip to content

Commit e265720

Browse files
committed
Test floating point overloads
1 parent 323919b commit e265720

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

libcxx/test/std/numerics/c.math/signbit.pass.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,5 +76,14 @@ int main(int, char**) {
7676
types::for_each(types::floating_point_types(), TestFloat());
7777
types::for_each(types::integral_types(), TestInt());
7878

79+
// Make sure we can call `std::signbit` with convertible types. This checks
80+
// whether overloads for all cv-unqualified floating-point types are working
81+
// as expected.
82+
{
83+
assert(!std::signbit(ConvertibleTo<float>()));
84+
assert(!std::signbit(ConvertibleTo<double>()));
85+
assert(!std::signbit(ConvertibleTo<long double>()));
86+
}
87+
7988
return 0;
8089
}

0 commit comments

Comments
 (0)