[libcxx-commits] [libcxx] a859df3 - [libc++] Add "using-if-exists" to timespec_get in modules (#78686)

via libcxx-commits libcxx-commits at lists.llvm.org
Mon Jan 22 09:09:17 PST 2024


Author: Dominik Wójt
Date: 2024-01-22T18:09:14+01:00
New Revision: a859df3b0a099648ec4cd305f22c87ea12ebaac9

URL: https://github.com/llvm/llvm-project/commit/a859df3b0a099648ec4cd305f22c87ea12ebaac9
DIFF: https://github.com/llvm/llvm-project/commit/a859df3b0a099648ec4cd305f22c87ea12ebaac9.diff

LOG: [libc++] Add "using-if-exists" to timespec_get in modules (#78686)

Picolibc does not provide timespec_get function. Adding
"using-if-exists" attribute fixes the modules.

This is a follow up patch for
https://github.com/llvm/llvm-project/pull/78580

Added: 
    

Modified: 
    libcxx/modules/std.compat/ctime.inc
    libcxx/modules/std/ctime.inc
    libcxx/test/libcxx/selftest/modules/std-and-std.compat-module.sh.cpp
    libcxx/test/libcxx/selftest/modules/std.compat-module.sh.cpp
    libcxx/test/std/modules/std.compat.pass.cpp

Removed: 
    


################################################################################
diff  --git a/libcxx/modules/std.compat/ctime.inc b/libcxx/modules/std.compat/ctime.inc
index 92e3403a5e58e2..6e621f494348d7 100644
--- a/libcxx/modules/std.compat/ctime.inc
+++ b/libcxx/modules/std.compat/ctime.inc
@@ -24,5 +24,5 @@ export {
   using ::mktime;
   using ::strftime;
   using ::time;
-  using ::timespec_get;
+  using ::timespec_get _LIBCPP_USING_IF_EXISTS;
 } // export

diff  --git a/libcxx/modules/std/ctime.inc b/libcxx/modules/std/ctime.inc
index c407ffc35e3fe3..c98cb28e649b85 100644
--- a/libcxx/modules/std/ctime.inc
+++ b/libcxx/modules/std/ctime.inc
@@ -24,5 +24,5 @@ export namespace std {
   using std::mktime;
   using std::strftime;
   using std::time;
-  using std::timespec_get;
+  using std::timespec_get _LIBCPP_USING_IF_EXISTS;
 } // namespace std

diff  --git a/libcxx/test/libcxx/selftest/modules/std-and-std.compat-module.sh.cpp b/libcxx/test/libcxx/selftest/modules/std-and-std.compat-module.sh.cpp
index 81241d7f43f9a1..d56ebb2961d4ae 100644
--- a/libcxx/test/libcxx/selftest/modules/std-and-std.compat-module.sh.cpp
+++ b/libcxx/test/libcxx/selftest/modules/std-and-std.compat-module.sh.cpp
@@ -12,10 +12,6 @@
 
 // XFAIL: has-no-cxx-module-support
 
-// picolibc does not provide the required timespec_get function, and the
-// "using-if-exists" mechanism apparently did not work here.
-// XFAIL: LIBCXX-PICOLIBC-FIXME
-
 // Make sure that the compile flags contain the expected elements.
 // The tests only look for the expected components and not the exact flags.
 // Otherwise changing the location of the module would break this test.

diff  --git a/libcxx/test/libcxx/selftest/modules/std.compat-module.sh.cpp b/libcxx/test/libcxx/selftest/modules/std.compat-module.sh.cpp
index b74c2f1a249fcc..e84709853fbca1 100644
--- a/libcxx/test/libcxx/selftest/modules/std.compat-module.sh.cpp
+++ b/libcxx/test/libcxx/selftest/modules/std.compat-module.sh.cpp
@@ -12,10 +12,6 @@
 
 // XFAIL: has-no-cxx-module-support
 
-// picolibc does not provide the required timespec_get function, and the
-// "using-if-exists" mechanism apparently did not work here.
-// XFAIL: LIBCXX-PICOLIBC-FIXME
-
 // Make sure that the compile flags contain the expected elements.
 // The tests only look for the expected components and not the exact flags.
 // Otherwise changing the location of the module would break this test.

diff  --git a/libcxx/test/std/modules/std.compat.pass.cpp b/libcxx/test/std/modules/std.compat.pass.cpp
index 40ea979e273465..e840f3c6b629cf 100644
--- a/libcxx/test/std/modules/std.compat.pass.cpp
+++ b/libcxx/test/std/modules/std.compat.pass.cpp
@@ -12,10 +12,6 @@
 
 // XFAIL: has-no-cxx-module-support
 
-// picolibc does not provide the required timespec_get function, and the
-// "using-if-exists" mechanism apparently did not work here.
-// XFAIL: LIBCXX-PICOLIBC-FIXME
-
 // A minimal test to validate import works.
 
 // MODULE_DEPENDENCIES: std.compat


        


More information about the libcxx-commits mailing list