Skip to content

Commit a5325ed

Browse files
mordantecopybara-github
authored andcommitted
[libc++][modules] Uses _LIBCPP_USING_IF_EXISTS. (#90409)
This attribute is used in the headers. Not using this in the modules has led to several issues. Add them to the modules to avoid these errors in other placed. NOKEYCHECK=True GitOrigin-RevId: 6c4dedde08686edea9a1d5173313f44ef23ee38e
1 parent 9d3538b commit a5325ed

33 files changed

+1023
-1023
lines changed

modules/std.compat/cctype.inc

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,18 @@
88
//===----------------------------------------------------------------------===//
99

1010
export {
11-
using ::isalnum;
12-
using ::isalpha;
13-
using ::isblank;
14-
using ::iscntrl;
15-
using ::isdigit;
16-
using ::isgraph;
17-
using ::islower;
18-
using ::isprint;
19-
using ::ispunct;
20-
using ::isspace;
21-
using ::isupper;
22-
using ::isxdigit;
23-
using ::tolower;
24-
using ::toupper;
11+
using ::isalnum _LIBCPP_USING_IF_EXISTS;
12+
using ::isalpha _LIBCPP_USING_IF_EXISTS;
13+
using ::isblank _LIBCPP_USING_IF_EXISTS;
14+
using ::iscntrl _LIBCPP_USING_IF_EXISTS;
15+
using ::isdigit _LIBCPP_USING_IF_EXISTS;
16+
using ::isgraph _LIBCPP_USING_IF_EXISTS;
17+
using ::islower _LIBCPP_USING_IF_EXISTS;
18+
using ::isprint _LIBCPP_USING_IF_EXISTS;
19+
using ::ispunct _LIBCPP_USING_IF_EXISTS;
20+
using ::isspace _LIBCPP_USING_IF_EXISTS;
21+
using ::isupper _LIBCPP_USING_IF_EXISTS;
22+
using ::isxdigit _LIBCPP_USING_IF_EXISTS;
23+
using ::tolower _LIBCPP_USING_IF_EXISTS;
24+
using ::toupper _LIBCPP_USING_IF_EXISTS;
2525
} // export

modules/std.compat/cfenv.inc

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,21 @@
99

1010
export {
1111
// types
12-
using ::fenv_t;
13-
using ::fexcept_t;
12+
using ::fenv_t _LIBCPP_USING_IF_EXISTS;
13+
using ::fexcept_t _LIBCPP_USING_IF_EXISTS;
1414

1515
// functions
16-
using ::feclearexcept;
17-
using ::fegetexceptflag;
18-
using ::feraiseexcept;
19-
using ::fesetexceptflag;
20-
using ::fetestexcept;
16+
using ::feclearexcept _LIBCPP_USING_IF_EXISTS;
17+
using ::fegetexceptflag _LIBCPP_USING_IF_EXISTS;
18+
using ::feraiseexcept _LIBCPP_USING_IF_EXISTS;
19+
using ::fesetexceptflag _LIBCPP_USING_IF_EXISTS;
20+
using ::fetestexcept _LIBCPP_USING_IF_EXISTS;
2121

22-
using ::fegetround;
23-
using ::fesetround;
22+
using ::fegetround _LIBCPP_USING_IF_EXISTS;
23+
using ::fesetround _LIBCPP_USING_IF_EXISTS;
2424

25-
using ::fegetenv;
26-
using ::feholdexcept;
27-
using ::fesetenv;
28-
using ::feupdateenv;
25+
using ::fegetenv _LIBCPP_USING_IF_EXISTS;
26+
using ::feholdexcept _LIBCPP_USING_IF_EXISTS;
27+
using ::fesetenv _LIBCPP_USING_IF_EXISTS;
28+
using ::feupdateenv _LIBCPP_USING_IF_EXISTS;
2929
} // export

modules/std.compat/cinttypes.inc

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@
88
//===----------------------------------------------------------------------===//
99

1010
export {
11-
using ::imaxdiv_t;
11+
using ::imaxdiv_t _LIBCPP_USING_IF_EXISTS;
1212

13-
using ::imaxabs;
14-
using ::imaxdiv;
15-
using ::strtoimax;
16-
using ::strtoumax;
17-
using ::wcstoimax;
18-
using ::wcstoumax;
13+
using ::imaxabs _LIBCPP_USING_IF_EXISTS;
14+
using ::imaxdiv _LIBCPP_USING_IF_EXISTS;
15+
using ::strtoimax _LIBCPP_USING_IF_EXISTS;
16+
using ::strtoumax _LIBCPP_USING_IF_EXISTS;
17+
using ::wcstoimax _LIBCPP_USING_IF_EXISTS;
18+
using ::wcstoumax _LIBCPP_USING_IF_EXISTS;
1919

2020
// abs is conditionally here, but always present in cmath.cppm. To avoid
2121
// conflicing declarations omit the using here.

modules/std.compat/clocale.inc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99

1010
export {
1111
#ifndef _LIBCPP_HAS_NO_LOCALIZATION
12-
using ::lconv;
12+
using ::lconv _LIBCPP_USING_IF_EXISTS;
1313

14-
using ::localeconv;
15-
using ::setlocale;
14+
using ::localeconv _LIBCPP_USING_IF_EXISTS;
15+
using ::setlocale _LIBCPP_USING_IF_EXISTS;
1616
#endif // _LIBCPP_HAS_NO_LOCALIZATION
1717
} // export

0 commit comments

Comments
 (0)