https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120171

            Bug ID: 120171
           Summary: Consider using custom glibc locales for testing
                    std::locale facets
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: redi at gcc dot gnu.org
            Blocks: 120170
  Target Milestone: ---

Some libstdc++ tests for locale facets are non-portable because they assume
e.g. nl_NL uses thousands separators, but that might be true on Linux and false
on BSD, or true on Fedora and false on Debian, or true today and then change to
false tomorrow.

When we want to test that std::locale correctly uses the underlying libc
locale's information, we don't really care whether or not thousands separators
are used in the Netherlands, we only care that the libstdc++ code is doing what
it's supposed to do for the underlying locale data.

If we created custom glibc locales we could have test locales with the exact
properties we want, so that we wouldn't rely on real data from glibc which can
change over time or between distros.

See https://sourceware.org/glibc/wiki/Locales#Testing_Locales for details on
testing custom locales.

Obviously this would only work for glibc-based targets, and so only for
--enable-clocale=gnu builds. It would still be useful though.


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120170
[Bug 120170] [meta-bug] C++ std::locale

Reply via email to