Skip to content

Commit c5ffdad

Browse files
domin144copybara-github
authored andcommitted
[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 llvm/llvm-project#78580 NOKEYCHECK=True GitOrigin-RevId: a859df3b0a099648ec4cd305f22c87ea12ebaac9
1 parent 3cc69ac commit c5ffdad

File tree

5 files changed

+2
-14
lines changed

5 files changed

+2
-14
lines changed

modules/std.compat/ctime.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,5 @@ export {
2424
using ::mktime;
2525
using ::strftime;
2626
using ::time;
27-
using ::timespec_get;
27+
using ::timespec_get _LIBCPP_USING_IF_EXISTS;
2828
} // export

modules/std/ctime.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,5 @@ export namespace std {
2424
using std::mktime;
2525
using std::strftime;
2626
using std::time;
27-
using std::timespec_get;
27+
using std::timespec_get _LIBCPP_USING_IF_EXISTS;
2828
} // namespace std

test/libcxx/selftest/modules/std-and-std.compat-module.sh.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@
1212

1313
// XFAIL: has-no-cxx-module-support
1414

15-
// picolibc does not provide the required timespec_get function, and the
16-
// "using-if-exists" mechanism apparently did not work here.
17-
// XFAIL: LIBCXX-PICOLIBC-FIXME
18-
1915
// Make sure that the compile flags contain the expected elements.
2016
// The tests only look for the expected components and not the exact flags.
2117
// Otherwise changing the location of the module would break this test.

test/libcxx/selftest/modules/std.compat-module.sh.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@
1212

1313
// XFAIL: has-no-cxx-module-support
1414

15-
// picolibc does not provide the required timespec_get function, and the
16-
// "using-if-exists" mechanism apparently did not work here.
17-
// XFAIL: LIBCXX-PICOLIBC-FIXME
18-
1915
// Make sure that the compile flags contain the expected elements.
2016
// The tests only look for the expected components and not the exact flags.
2117
// Otherwise changing the location of the module would break this test.

test/std/modules/std.compat.pass.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@
1212

1313
// XFAIL: has-no-cxx-module-support
1414

15-
// picolibc does not provide the required timespec_get function, and the
16-
// "using-if-exists" mechanism apparently did not work here.
17-
// XFAIL: LIBCXX-PICOLIBC-FIXME
18-
1915
// A minimal test to validate import works.
2016

2117
// MODULE_DEPENDENCIES: std.compat

0 commit comments

Comments
 (0)