diff --git a/libcxx/docs/FeatureTestMacroTable.rst b/libcxx/docs/FeatureTestMacroTable.rst --- a/libcxx/docs/FeatureTestMacroTable.rst +++ b/libcxx/docs/FeatureTestMacroTable.rst @@ -394,7 +394,7 @@ --------------------------------------------------- ----------------- ``__cpp_lib_hazard_pointer`` *unimplemented* --------------------------------------------------- ----------------- - ``__cpp_lib_ratio`` *unimplemented* + ``__cpp_lib_ratio`` ``202306L`` --------------------------------------------------- ----------------- ``__cpp_lib_rcu`` *unimplemented* --------------------------------------------------- ----------------- diff --git a/libcxx/docs/Status/Cxx2cPapers.csv b/libcxx/docs/Status/Cxx2cPapers.csv --- a/libcxx/docs/Status/Cxx2cPapers.csv +++ b/libcxx/docs/Status/Cxx2cPapers.csv @@ -22,7 +22,7 @@ "`P1759R6 `__","LWG","Native handles and file streams","Varna June 2023","","","" "`P2697R1 `__","LWG","Interfacing ``bitset`` with ``string_view``","Varna June 2023","","","" "`P1383R2 `__","LWG","More ``constexpr`` for ```` and ````","Varna June 2023","","","" -"`P2734R0 `__","LWG","Adding the new SI prefixes","Varna June 2023","","","" +"`P2734R0 `__","LWG","Adding the new SI prefixes","Varna June 2023","|Complete|","Clang 17","" "`P2548R6 `__","LWG","``copyable_function``","Varna June 2023","","","" "`P2714R1 `__","LWG","Bind front and back to NTTP callables","Varna June 2023","","","" "`P2630R4 `__","LWG","``submdspan``","Varna June 2023","","","" diff --git a/libcxx/include/ratio b/libcxx/include/ratio --- a/libcxx/include/ratio +++ b/libcxx/include/ratio @@ -40,6 +40,8 @@ template struct ratio_greater_equal; // convenience SI typedefs +using quecto = ratio <1, 1'000'000'000'000'000'000'000'000'000'000>; // Since C++26; not supported +using ronto = ratio <1, 1'000'000'000'000'000'000'000'000'000>; // Since C++26; not supported typedef ratio<1, 1000000000000000000000000> yocto; // not supported typedef ratio<1, 1000000000000000000000> zepto; // not supported typedef ratio<1, 1000000000000000000> atto; @@ -60,6 +62,8 @@ typedef ratio< 1000000000000000000, 1> exa; typedef ratio< 1000000000000000000000, 1> zetta; // not supported typedef ratio<1000000000000000000000000, 1> yotta; // not supported +using ronna = ratio <1'000'000'000'000'000'000'000'000'000, 1>; // Since C++26; not supported +using quetta = ratio <1'000'000'000'000'000'000'000'000'000'000, 1>; // Since C++26; not supported // 20.11.5, ratio comparison template inline constexpr bool ratio_equal_v diff --git a/libcxx/include/version b/libcxx/include/version --- a/libcxx/include/version +++ b/libcxx/include/version @@ -456,7 +456,7 @@ // # define __cpp_lib_fstream_native_handle 202306L // # define __cpp_lib_function_ref 202306L // # define __cpp_lib_hazard_pointer 202306L -// # define __cpp_lib_ratio 202306L +# define __cpp_lib_ratio 202306L // # define __cpp_lib_rcu 202306L // # define __cpp_lib_smart_ptr_owner_equality 202306L // # define __cpp_lib_sstream_from_string_view 202306L diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/ratio.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/ratio.version.compile.pass.cpp --- a/libcxx/test/std/language.support/support.limits/support.limits.general/ratio.version.compile.pass.cpp +++ b/libcxx/test/std/language.support/support.limits/support.limits.general/ratio.version.compile.pass.cpp @@ -54,17 +54,11 @@ #elif TEST_STD_VER > 23 -# if !defined(_LIBCPP_VERSION) -# ifndef __cpp_lib_ratio -# error "__cpp_lib_ratio should be defined in c++26" -# endif -# if __cpp_lib_ratio != 202306L -# error "__cpp_lib_ratio should have the value 202306L in c++26" -# endif -# else // _LIBCPP_VERSION -# ifdef __cpp_lib_ratio -# error "__cpp_lib_ratio should not be defined because it is unimplemented in libc++!" -# endif +# ifndef __cpp_lib_ratio +# error "__cpp_lib_ratio should be defined in c++26" +# endif +# if __cpp_lib_ratio != 202306L +# error "__cpp_lib_ratio should have the value 202306L in c++26" # endif #endif // TEST_STD_VER > 23 diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/version.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/version.version.compile.pass.cpp --- a/libcxx/test/std/language.support/support.limits/support.limits.general/version.version.compile.pass.cpp +++ b/libcxx/test/std/language.support/support.limits/support.limits.general/version.version.compile.pass.cpp @@ -6511,17 +6511,11 @@ # endif # endif -# if !defined(_LIBCPP_VERSION) -# ifndef __cpp_lib_ratio -# error "__cpp_lib_ratio should be defined in c++26" -# endif -# if __cpp_lib_ratio != 202306L -# error "__cpp_lib_ratio should have the value 202306L in c++26" -# endif -# else // _LIBCPP_VERSION -# ifdef __cpp_lib_ratio -# error "__cpp_lib_ratio should not be defined because it is unimplemented in libc++!" -# endif +# ifndef __cpp_lib_ratio +# error "__cpp_lib_ratio should be defined in c++26" +# endif +# if __cpp_lib_ratio != 202306L +# error "__cpp_lib_ratio should have the value 202306L in c++26" # endif # ifndef __cpp_lib_raw_memory_algorithms diff --git a/libcxx/utils/generate_feature_test_macro_components.py b/libcxx/utils/generate_feature_test_macro_components.py --- a/libcxx/utils/generate_feature_test_macro_components.py +++ b/libcxx/utils/generate_feature_test_macro_components.py @@ -847,7 +847,6 @@ "name": "__cpp_lib_ratio", "values": {"c++26": 202306}, # P2734R0 Adding the new SI prefixes "headers": ["ratio"], - "unimplemented": True, }, { "name": "__cpp_lib_raw_memory_algorithms",