[libcxx-commits] [libcxx] [libc++] Remove obsolete locale-specific regex tests (PR #159590)

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Fri Sep 19 12:31:56 PDT 2025


================
@@ -1,136 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <regex>
-
-// template <class BidirectionalIterator, class Allocator, class charT,
-//           class traits>
-//   bool regex_match(BidirectionalIterator first, BidirectionalIterator last,
-//                    match_results<BidirectionalIterator, Allocator>& m,
-//                    const basic_regex<charT, traits>& e,
-//                    regex_constants::match_flag_type flags
-//                                            = regex_constants::match_default);
-
-// TODO: investigation needed
-// TODO(netbsd): incomplete support for locales
-// XFAIL: target={{.*}}-linux-gnu{{.*}}, netbsd, freebsd
-// XFAIL: target={{.*}}-amazon-linux{{.*}}
-// XFAIL: target={{.*}}-apple-{{.*}}
-// REQUIRES: locale.cs_CZ.ISO8859-2
-
-#include <regex>
-#include <cassert>
-#include "test_macros.h"
-#include "test_iterators.h"
-
-#include "platform_support.h" // locale name macros
-
-int main(int, char**)
-{
-    std::locale::global(std::locale(LOCALE_cs_CZ_ISO8859_2));
----------------
ldionne wrote:

Actually, the idea of creating our own locale for testing makes a lot of sense. It could greatly reduce the complexity associated with locale testing everywhere in the test suite.

That being said, after spending about an hour reading on how to create locales and doing some research on how that's done on macOS, it seems to be pretty platform-dependent. There's also the part of letting the custom local be picked up I haven't managed to get working yet. There may be an easy to way to do it, but it's not very well documented unless I missed something obvious. IIUC we'd have to do the same for each of the platforms that we support (hopefully several platforms share a similar behavior).

For the time being, I've created https://github.com/llvm/llvm-project/issues/159836 to track this. While I think it would be a good idea, I think I'd want to bundle that work along with other improvements to the localization facilities, otherwise the value provided for the amount of time invested seems like a difficult pitch.

https://github.com/llvm/llvm-project/pull/159590


More information about the libcxx-commits mailing list