Skip to content

Commit d29c947

Browse files
committed
[libc++][AIX] Correct the definition of __regex_word for AIX
Summary: The patch changes the definition of __regex_word to 0x8000 for AIX because the current definition 0x80 clashes with ctype_base::print (_ISPRINT is defined as 0x80 in AIX ctype.h). Reviewed by: Mordante, hubert.reinterpretcast, libc++ Differential Revision: https://reviews.llvm.org/D129862
1 parent 45067f8 commit d29c947

File tree

3 files changed

+4
-7
lines changed

3 files changed

+4
-7
lines changed

libcxx/include/__locale

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,11 @@ public:
492492
static const mask punct = _ISPUNCT;
493493
static const mask xdigit = _ISXDIGIT;
494494
static const mask blank = _ISBLANK;
495+
# if defined(_AIX)
496+
static const mask __regex_word = 0x8000;
497+
# else
495498
static const mask __regex_word = 0x80;
499+
# endif
496500
#elif defined(_NEWLIB_VERSION)
497501
// Same type as Newlib's _ctype_ array in newlib/libc/include/ctype.h.
498502
typedef char mask;
@@ -545,11 +549,8 @@ public:
545549

546550
_LIBCPP_INLINE_VISIBILITY ctype_base() {}
547551

548-
// TODO: Remove the ifndef when the assert no longer fails on AIX.
549-
#ifndef _AIX
550552
static_assert((__regex_word & ~(space | print | cntrl | upper | lower | alpha | digit | punct | xdigit | blank)) == __regex_word,
551553
"__regex_word can't overlap other bits");
552-
#endif
553554
};
554555

555556
template <class _CharT> class _LIBCPP_TEMPLATE_VIS ctype;

libcxx/test/std/re/re.traits/isctype.pass.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9-
// XFAIL: LIBCXX-AIX-FIXME
10-
119
// <regex>
1210

1311
// template <class charT> struct regex_traits;

libcxx/test/std/re/re.traits/lookup_classname.pass.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9-
// XFAIL: LIBCXX-AIX-FIXME
10-
119
// <regex>
1210

1311
// template <class charT> struct regex_traits;

0 commit comments

Comments
 (0)