Issue |
159932
|
Summary |
[libc]: error: implicit conversion loses floating-point precision: 'double' to 'float'
|
Labels |
libc
|
Assignees |
|
Reporter |
makslevental
|
This is failing in pre-merge CI:
```
FAILED: libc/test/shared/CMakeFiles/libc.test.shared.shared_math_test.__unit__.__NO_FMA_OPT.__build__.dir/shared_math_test.cpp.o
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/./bin/clang++ --target=x86_64-unknown-linux-gnu -DLIBC_NAMESPACE=__llvm_libc_22_0_0_git -I/home/gha/actions-runner/_work/llvm-project/llvm-project/libc -isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/runtimes/runtimes-bins/libc/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -O3 -DNDEBUG -std=gnu++17 -UNDEBUG -msse4.2 -DLIBC_QSORT_IMPL=LIBC_QSORT_QUICK_SORT -DLIBC_ADD_NULL_CHECKS -DLIBC_ERRNO_MODE=LIBC_ERRNO_MODE_DEFAULT -DLIBC_THREAD_MODE=LIBC_THREAD_MODE_PLATFORM -fpie -ffixed-point -Wconversion -Wno-sign-conversion -Wimplicit-fallthrough -Wwrite-strings -Wno-c99-extensions -Wno-gnu-imaginary-constant -Wno-pedantic -Wstrict-prototypes -Wextra-semi -Wnewline-eof -Wnonportable-system-include-path -Wthread-safety -DLIBC_TEST=UNIT -MD -MT libc/test/shared/CMakeFiles/libc.test.shared.shared_math_test.__unit__.__NO_FMA_OPT.__build__.dir/shared_math_test.cpp.o -MF libc/test/shared/CMakeFiles/libc.test.shared.shared_math_test.__unit__.__NO_FMA_OPT.__build__.dir/shared_math_test.cpp.o.d -o libc/test/shared/CMakeFiles/libc.test.shared.shared_math_test.__unit__.__NO_FMA_OPT.__build__.dir/shared_math_test.cpp.o -c /home/gha/actions-runner/_work/llvm-project/llvm-project/libc/test/shared/shared_math_test.cpp
In file included from /home/gha/actions-runner/_work/llvm-project/llvm-project/libc/test/shared/shared_math_test.cpp:10:
In file included from /home/gha/actions-runner/_work/llvm-project/llvm-project/libc/test/UnitTest/FPMatcher.h:20:
In file included from /home/gha/actions-runner/_work/llvm-project/llvm-project/libc/test/UnitTest/ErrnoCheckingTest.h:14:
In file included from /home/gha/actions-runner/_work/llvm-project/llvm-project/libc/test/UnitTest/Test.h:37:
/home/gha/actions-runner/_work/llvm-project/llvm-project/libc/test/UnitTest/LibcTest.h:204:36: error: implicit conversion loses floating-point precision: 'double' to 'float' [-Werror,-Wimplicit-float-conversion]
204 | return testMatch(Matcher.match(Value), Matcher, ValueStr, MatcherStr, Loc);
| ~~~~~ ^~~~~
/home/gha/actions-runner/_work/llvm-project/llvm-project/libc/test/shared/shared_math_test.cpp:60:3: note: in instantiation of function template specialization '__llvm_libc_22_0_0_git::testing::Test::matchAndExplain<__llvm_libc_22_0_0_git::testing::FPMatcher<float, __llvm_libc_22_0_0_git::testing::TestCond::EQ>, double>' requested here
60 | EXPECT_FP_EQ(0x0p+0f, LIBC_NAMESPACE::shared::dsqrtl(0.0f));
| ^
/home/gha/actions-runner/_work/llvm-project/llvm-project/libc/test/UnitTest/FPMatcher.h:269:3: note: expanded from macro 'EXPECT_FP_EQ'
269 | EXPECT_THAT(actual, LIBC_NAMESPACE::testing::getMatcher< \
| ^
/home/gha/actions-runner/_work/llvm-project/llvm-project/libc/test/UnitTest/LibcTest.h:514:3: note: expanded from macro 'EXPECT_THAT'
514 | LIBC_TEST_MATCH_(MATCHER, MATCH, #MATCHER, #MATCH, )
| ^
/home/gha/actions-runner/_work/llvm-project/llvm-project/libc/test/UnitTest/LibcTest.h:509:26: note: expanded from macro 'LIBC_TEST_MATCH_'
509 | LIBC_TEST_SCAFFOLDING_(matchAndExplain(MATCHER, MATCH, MATCHER_STR, \
| ^
/home/gha/actions-runner/_work/llvm-project/llvm-project/libc/test/UnitTest/LibcTest.h:428:7: note: expanded from macro 'LIBC_TEST_SCAFFOLDING_'
428 | if (TEST) \
| ^
1 error generated.
```
https://github.com/llvm/llvm-project/actions/runs/17881746032/attempts/1
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs