Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Clang 18+ /fp:fast emits -Wnan-infinity-disabled in VSO_0000000_vector_algorithms_floats #4931

@CaseyCarter

Description

@CaseyCarter

All 8 clang-cl /fp:fast configs have the same issue. For example:

Error log for clang-cl /fp:fast /MT without /D_USE_STD_VECTOR_ALGORITHMS=0
FAIL: std :: tests/VSO_0000000_vector_algorithms_floats:16 (6 of 24)
******************** TEST 'std :: tests/VSO_0000000_vector_algorithms_floats:16' FAILED ********************
Build setup steps:
Build steps:
Build step failed unexpectedly.
Command: "c:\Program Files\LLVM19\bin\clang-cl.EXE" "C:\STL\tests\std\tests\VSO_0000000_vector_algorithms_floats\test.cpp" "-IC:\STL\out\x64\out\inc" "-IC:\STL\llvm-project\libcxx\test\support" "-IC:\STL\tests\std\include" "/nologo" "/Od" "/W4" "/w14061" "/w14242" "/w14265" "/w14582" "/w14583" "/w14587" "/w14588" "/w14749" "/w14841" "/w14842" "/w15038" "/w15214" "/w15215" "/w15216" "/w15217" "/w15262" "/sdl" "/WX" "/D_ENABLE_STL_INTERNAL_CHECK" "/bigobj" "/FIforce_include.hpp" "/w14365" "/w14668" "/w15267" "/D_ENFORCE_FACET_SPECIALIZATIONS=1" "/D_STL_CALL_ABORT_INSTEAD_OF_INVALID_PARAMETER" "-fno-ms-compatibility" "-fno-delayed-template-parsing" "-Wno-unqualified-std-cast-call" "/EHsc" "/MT" "/std:c++20" "/permissive-" "/w14640" "/Zc:threadSafeInit-" "--start-no-unused-arguments" "/fp:fast" "-m64" "-FeC:\STL\out\x64\tests\std\tests\VSO_0000000_vector_algorithms_floats\Output\16\VSO_0000000_vector_algorithms_floats.exe" "-link" "-LIBPATH:C:\STL\out\x64\out\lib\amd64" "-LIBPATH:C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.42.34226\lib\x64" "/MANIFEST:EMBED"
Exit Code: 1 (0x1)
Standard Error:
--
In file included from C:\STL\tests\std\tests\VSO_0000000_vector_algorithms_floats\test.cpp:5:
C:\STL\out\x64\out\inc\limits(883,16): error: use of NaN is undefined behavior due to the currently enabled floating-point options [-Werror,-Wnan-infinity-disabled]
  883 |         return __builtin_nanf("0");
      |                ^~~~~~~~~~~~~~~~~~~
In file included from C:\STL\tests\std\tests\VSO_0000000_vector_algorithms_floats\test.cpp:6:
In file included from C:\STL\out\x64\out\inc\random:13:
C:\STL\out\x64\out\inc\cmath(671,1): error: use of infinity is undefined behavior due to the currently enabled floating-point options [-Werror,-Wnan-infinity-disabled]
  671 | _CLANG_BUILTIN1(isfinite)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~
C:\STL\out\x64\out\inc\cmath(662,5): note: expanded from macro '_CLANG_BUILTIN1'
  662 |     _CLANG_BUILTIN1_ARG(NAME, float)  \
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\STL\out\x64\out\inc\cmath(605,16): note: expanded from macro '_CLANG_BUILTIN1_ARG'
  605 |         return __builtin_##NAME(_Xx);                                                            \
      |                ^~~~~~~~~~~~~~~~~~~~~
(196,1): note: expanded from here
  196 | __builtin_isfinite
      | ^
In file included from C:\STL\tests\std\tests\VSO_0000000_vector_algorithms_floats\test.cpp:6:
In file included from C:\STL\out\x64\out\inc\random:13:
C:\STL\out\x64\out\inc\cmath(671,1): error: use of infinity is undefined behavior due to the currently enabled floating-point options [-Werror,-Wnan-infinity-disabled]
  671 | _CLANG_BUILTIN1(isfinite)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~
C:\STL\out\x64\out\inc\cmath(663,5): note: expanded from macro '_CLANG_BUILTIN1'
  663 |     _CLANG_BUILTIN1_ARG(NAME, double) \
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\STL\out\x64\out\inc\cmath(605,16): note: expanded from macro '_CLANG_BUILTIN1_ARG'
  605 |         return __builtin_##NAME(_Xx);                                                            \
      |                ^~~~~~~~~~~~~~~~~~~~~
(199,1): note: expanded from here
  199 | __builtin_isfinite
      | ^
In file included from C:\STL\tests\std\tests\VSO_0000000_vector_algorithms_floats\test.cpp:6:
In file included from C:\STL\out\x64\out\inc\random:13:
C:\STL\out\x64\out\inc\cmath(671,1): error: use of infinity is undefined behavior due to the currently enabled floating-point options [-Werror,-Wnan-infinity-disabled]
  671 | _CLANG_BUILTIN1(isfinite)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~
C:\STL\out\x64\out\inc\cmath(664,5): note: expanded from macro '_CLANG_BUILTIN1'
  664 |     _CLANG_BUILTIN1_ARG(NAME, long double)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\STL\out\x64\out\inc\cmath(605,16): note: expanded from macro '_CLANG_BUILTIN1_ARG'
  605 |         return __builtin_##NAME(_Xx);                                                            \
      |                ^~~~~~~~~~~~~~~~~~~~~
(202,1): note: expanded from here
  202 | __builtin_isfinite
      | ^
In file included from C:\STL\tests\std\tests\VSO_0000000_vector_algorithms_floats\test.cpp:6:
In file included from C:\STL\out\x64\out\inc\random:13:
C:\STL\out\x64\out\inc\cmath(672,1): error: use of infinity is undefined behavior due to the currently enabled floating-point options [-Werror,-Wnan-infinity-disabled]
  672 | _CLANG_BUILTIN1(isinf)
      | ^~~~~~~~~~~~~~~~~~~~~~
C:\STL\out\x64\out\inc\cmath(662,5): note: expanded from macro '_CLANG_BUILTIN1'
  662 |     _CLANG_BUILTIN1_ARG(NAME, float)  \
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\STL\out\x64\out\inc\cmath(605,16): note: expanded from macro '_CLANG_BUILTIN1_ARG'
  605 |         return __builtin_##NAME(_Xx);                                                            \
      |                ^~~~~~~~~~~~~~~~~~~~~
(205,1): note: expanded from here
  205 | __builtin_isinf
      | ^
In file included from C:\STL\tests\std\tests\VSO_0000000_vector_algorithms_floats\test.cpp:6:
In file included from C:\STL\out\x64\out\inc\random:13:
C:\STL\out\x64\out\inc\cmath(672,1): error: use of infinity is undefined behavior due to the currently enabled floating-point options [-Werror,-Wnan-infinity-disabled]
  672 | _CLANG_BUILTIN1(isinf)
      | ^~~~~~~~~~~~~~~~~~~~~~
C:\STL\out\x64\out\inc\cmath(663,5): note: expanded from macro '_CLANG_BUILTIN1'
  663 |     _CLANG_BUILTIN1_ARG(NAME, double) \
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\STL\out\x64\out\inc\cmath(605,16): note: expanded from macro '_CLANG_BUILTIN1_ARG'
  605 |         return __builtin_##NAME(_Xx);                                                            \
      |                ^~~~~~~~~~~~~~~~~~~~~
(208,1): note: expanded from here
  208 | __builtin_isinf
      | ^
In file included from C:\STL\tests\std\tests\VSO_0000000_vector_algorithms_floats\test.cpp:6:
In file included from C:\STL\out\x64\out\inc\random:13:
C:\STL\out\x64\out\inc\cmath(672,1): error: use of infinity is undefined behavior due to the currently enabled floating-point options [-Werror,-Wnan-infinity-disabled]
  672 | _CLANG_BUILTIN1(isinf)
      | ^~~~~~~~~~~~~~~~~~~~~~
C:\STL\out\x64\out\inc\cmath(664,5): note: expanded from macro '_CLANG_BUILTIN1'
  664 |     _CLANG_BUILTIN1_ARG(NAME, long double)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\STL\out\x64\out\inc\cmath(605,16): note: expanded from macro '_CLANG_BUILTIN1_ARG'
  605 |         return __builtin_##NAME(_Xx);                                                            \
      |                ^~~~~~~~~~~~~~~~~~~~~
(211,1): note: expanded from here
  211 | __builtin_isinf
      | ^
In file included from C:\STL\tests\std\tests\VSO_0000000_vector_algorithms_floats\test.cpp:6:
In file included from C:\STL\out\x64\out\inc\random:13:
C:\STL\out\x64\out\inc\cmath(673,1): error: use of NaN is undefined behavior due to the currently enabled floating-point options [-Werror,-Wnan-infinity-disabled]
  673 | _CLANG_BUILTIN1(isnan)
      | ^~~~~~~~~~~~~~~~~~~~~~
C:\STL\out\x64\out\inc\cmath(662,5): note: expanded from macro '_CLANG_BUILTIN1'
  662 |     _CLANG_BUILTIN1_ARG(NAME, float)  \
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\STL\out\x64\out\inc\cmath(605,16): note: expanded from macro '_CLANG_BUILTIN1_ARG'
  605 |         return __builtin_##NAME(_Xx);                                                            \
      |                ^~~~~~~~~~~~~~~~~~~~~
(214,1): note: expanded from here
  214 | __builtin_isnan
      | ^
In file included from C:\STL\tests\std\tests\VSO_0000000_vector_algorithms_floats\test.cpp:6:
In file included from C:\STL\out\x64\out\inc\random:13:
C:\STL\out\x64\out\inc\cmath(673,1): error: use of NaN is undefined behavior due to the currently enabled floating-point options [-Werror,-Wnan-infinity-disabled]
  673 | _CLANG_BUILTIN1(isnan)
      | ^~~~~~~~~~~~~~~~~~~~~~
C:\STL\out\x64\out\inc\cmath(663,5): note: expanded from macro '_CLANG_BUILTIN1'
  663 |     _CLANG_BUILTIN1_ARG(NAME, double) \
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\STL\out\x64\out\inc\cmath(605,16): note: expanded from macro '_CLANG_BUILTIN1_ARG'
  605 |         return __builtin_##NAME(_Xx);                                                            \
      |                ^~~~~~~~~~~~~~~~~~~~~
(217,1): note: expanded from here
  217 | __builtin_isnan
      | ^
In file included from C:\STL\tests\std\tests\VSO_0000000_vector_algorithms_floats\test.cpp:6:
In file included from C:\STL\out\x64\out\inc\random:13:
C:\STL\out\x64\out\inc\cmath(673,1): error: use of NaN is undefined behavior due to the currently enabled floating-point options [-Werror,-Wnan-infinity-disabled]
  673 | _CLANG_BUILTIN1(isnan)
      | ^~~~~~~~~~~~~~~~~~~~~~
C:\STL\out\x64\out\inc\cmath(664,5): note: expanded from macro '_CLANG_BUILTIN1'
  664 |     _CLANG_BUILTIN1_ARG(NAME, long double)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\STL\out\x64\out\inc\cmath(605,16): note: expanded from macro '_CLANG_BUILTIN1_ARG'
  605 |         return __builtin_##NAME(_Xx);                                                            \
      |                ^~~~~~~~~~~~~~~~~~~~~
(220,1): note: expanded from here
  220 | __builtin_isnan
      | ^
In file included from C:\STL\tests\std\tests\VSO_0000000_vector_algorithms_floats\test.cpp:6:
In file included from C:\STL\out\x64\out\inc\random:13:
C:\STL\out\x64\out\inc\cmath(681,1): error: use of NaN is undefined behavior due to the currently enabled floating-point options [-Werror,-Wnan-infinity-disabled]
  681 | _CLANG_BUILTIN2(isunordered)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\STL\out\x64\out\inc\cmath(667,5): note: expanded from macro '_CLANG_BUILTIN2'
  667 |     _CLANG_BUILTIN2_ARG(NAME, float)  \
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\STL\out\x64\out\inc\cmath(611,16): note: expanded from macro '_CLANG_BUILTIN2_ARG'
  611 |         return __builtin_##NAME(_Xx, _Yx);                                                               \
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~
(293,1): note: expanded from here
  293 | __builtin_isunordered
      | ^
In file included from C:\STL\tests\std\tests\VSO_0000000_vector_algorithms_floats\test.cpp:6:
In file included from C:\STL\out\x64\out\inc\random:13:
C:\STL\out\x64\out\inc\cmath(681,1): error: use of NaN is undefined behavior due to the currently enabled floating-point options [-Werror,-Wnan-infinity-disabled]
  681 | _CLANG_BUILTIN2(isunordered)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\STL\out\x64\out\inc\cmath(668,5): note: expanded from macro '_CLANG_BUILTIN2'
  668 |     _CLANG_BUILTIN2_ARG(NAME, double) \
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\STL\out\x64\out\inc\cmath(611,16): note: expanded from macro '_CLANG_BUILTIN2_ARG'
  611 |         return __builtin_##NAME(_Xx, _Yx);                                                               \
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~
(297,1): note: expanded from here
  297 | __builtin_isunordered
      | ^
In file included from C:\STL\tests\std\tests\VSO_0000000_vector_algorithms_floats\test.cpp:6:
In file included from C:\STL\out\x64\out\inc\random:13:
C:\STL\out\x64\out\inc\cmath(681,1): error: use of NaN is undefined behavior due to the currently enabled floating-point options [-Werror,-Wnan-infinity-disabled]
  681 | _CLANG_BUILTIN2(isunordered)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\STL\out\x64\out\inc\cmath(669,5): note: expanded from macro '_CLANG_BUILTIN2'
  669 |     _CLANG_BUILTIN2_ARG(NAME, long double)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\STL\out\x64\out\inc\cmath(611,16): note: expanded from macro '_CLANG_BUILTIN2_ARG'
  611 |         return __builtin_##NAME(_Xx, _Yx);                                                               \
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~
(301,1): note: expanded from here
  301 | __builtin_isunordered
      | ^
In file included from C:\STL\tests\std\tests\VSO_0000000_vector_algorithms_floats\test.cpp:6:
In file included from C:\STL\out\x64\out\inc\random:13:
C:\STL\out\x64\out\inc\cmath(688,1): error: use of NaN is undefined behavior due to the currently enabled floating-point options [-Werror,-Wnan-infinity-disabled]
  688 | _CLANG_BUILTIN2_TEMPLATED(isunordered)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\STL\out\x64\out\inc\cmath(641,5): note: expanded from macro '_CLANG_BUILTIN2_TEMPLATED'
  641 |     _CLANG_BUILTIN2_ARG_TEMPLATED(NAME, float)              \
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\STL\out\x64\out\inc\cmath(617,16): note: expanded from macro '_CLANG_BUILTIN2_ARG_TEMPLATED'
  617 |         return __builtin_##NAME(static_cast(_Xx), static_cast(_Yx));                     \
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
(81,1): note: expanded from here
   81 | __builtin_isunordered
      | ^
In file included from C:\STL\tests\std\tests\VSO_0000000_vector_algorithms_floats\test.cpp:6:
In file included from C:\STL\out\x64\out\inc\random:13:
C:\STL\out\x64\out\inc\cmath(688,1): error: use of NaN is undefined behavior due to the currently enabled floating-point options [-Werror,-Wnan-infinity-disabled]
  688 | _CLANG_BUILTIN2_TEMPLATED(isunordered)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\STL\out\x64\out\inc\cmath(642,5): note: expanded from macro '_CLANG_BUILTIN2_TEMPLATED'
  642 |     _CLANG_BUILTIN2_ARG_TEMPLATED(NAME, double)             \
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\STL\out\x64\out\inc\cmath(617,16): note: expanded from macro '_CLANG_BUILTIN2_ARG_TEMPLATED'
  617 |         return __builtin_##NAME(static_cast(_Xx), static_cast(_Yx));                     \
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
(85,1): note: expanded from here
   85 | __builtin_isunordered
      | ^
In file included from C:\STL\tests\std\tests\VSO_0000000_vector_algorithms_floats\test.cpp:6:
In file included from C:\STL\out\x64\out\inc\random:13:
C:\STL\out\x64\out\inc\cmath(688,1): error: use of NaN is undefined behavior due to the currently enabled floating-point options [-Werror,-Wnan-infinity-disabled]
  688 | _CLANG_BUILTIN2_TEMPLATED(isunordered)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\STL\out\x64\out\inc\cmath(643,5): note: expanded from macro '_CLANG_BUILTIN2_TEMPLATED'
  643 |     _CLANG_BUILTIN2_ARG_TEMPLATED(NAME, long double)        \
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\STL\out\x64\out\inc\cmath(617,16): note: expanded from macro '_CLANG_BUILTIN2_ARG_TEMPLATED'
  617 |         return __builtin_##NAME(static_cast(_Xx), static_cast(_Yx));                     \
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
(89,1): note: expanded from here
   89 | __builtin_isunordered
      | ^
In file included from C:\STL\tests\std\tests\VSO_0000000_vector_algorithms_floats\test.cpp:6:
In file included from C:\STL\out\x64\out\inc\random:13:
C:\STL\out\x64\out\inc\cmath(688,1): error: use of NaN is undefined behavior due to the currently enabled floating-point options [-Werror,-Wnan-infinity-disabled]
  688 | _CLANG_BUILTIN2_TEMPLATED(isunordered)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\STL\out\x64\out\inc\cmath(644,5): note: expanded from macro '_CLANG_BUILTIN2_TEMPLATED'
  644 |     _CLANG_BUILTIN2_ARG_TEMPLATED(NAME, signed char)        \
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\STL\out\x64\out\inc\cmath(617,16): note: expanded from macro '_CLANG_BUILTIN2_ARG_TEMPLATED'
  617 |         return __builtin_##NAME(static_cast(_Xx), static_cast(_Yx));                     \
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
(93,1): note: expanded from here
   93 | __builtin_isunordered
      | ^
In file included from C:\STL\tests\std\tests\VSO_0000000_vector_algorithms_floats\test.cpp:6:
In file included from C:\STL\out\x64\out\inc\random:13:
C:\STL\out\x64\out\inc\cmath(688,1): error: use of NaN is undefined behavior due to the currently enabled floating-point options [-Werror,-Wnan-infinity-disabled]
  688 | _CLANG_BUILTIN2_TEMPLATED(isunordered)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\STL\out\x64\out\inc\cmath(645,5): note: expanded from macro '_CLANG_BUILTIN2_TEMPLATED'
  645 |     _CLANG_BUILTIN2_ARG_TEMPLATED(NAME, short)              \
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\STL\out\x64\out\inc\cmath(617,16): note: expanded from macro '_CLANG_BUILTIN2_ARG_TEMPLATED'
  617 |         return __builtin_##NAME(static_cast(_Xx), static_cast(_Yx));                     \
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
(97,1): note: expanded from here
   97 | __builtin_isunordered
      | ^
In file included from C:\STL\tests\std\tests\VSO_0000000_vector_algorithms_floats\test.cpp:6:
In file included from C:\STL\out\x64\out\inc\random:13:
C:\STL\out\x64\out\inc\cmath(688,1): error: use of NaN is undefined behavior due to the currently enabled floating-point options [-Werror,-Wnan-infinity-disabled]
  688 | _CLANG_BUILTIN2_TEMPLATED(isunordered)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\STL\out\x64\out\inc\cmath(646,5): note: expanded from macro '_CLANG_BUILTIN2_TEMPLATED'
  646 |     _CLANG_BUILTIN2_ARG_TEMPLATED(NAME, int)                \
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\STL\out\x64\out\inc\cmath(617,16): note: expanded from macro '_CLANG_BUILTIN2_ARG_TEMPLATED'
  617 |         return __builtin_##NAME(static_cast(_Xx), static_cast(_Yx));                     \
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
(101,1): note: expanded from here
  101 | __builtin_isunordered
      | ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
--

#4932 will silence these warnings for the time being.

Metadata

Metadata

Assignees

No one assigned

    Labels

    fixedSomething works now, yay!testRelated to test code

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions