std::regexp with GCC 7.3.1 on AIX, Japanese

Jonathan Wakely
Mon Mar 30 15:46:06 GMT 2020

On Mon, 30 Mar 2020 at 15:13, <> wrote:
> Hi!
> Does anyone knows why std::regexp constructor fail on AIX (Japanese) or
> how to make-it work?

It's a problem with the std::collate facet, not std::regex:

#include <iostream>
#include <locale>

using namespace std;

int main()
   setlocale(LC_ALL, "Ja_JP");
   char* pLocale = setlocale(LC_ALL, NULL);
   cout << "setlocale(): " << pLocale << endl;

   char s[] = "\200";
   locale l;
   const collate<char>& c = use_facet<collate<char>>(l);
   c.transform(s, s+1);

I'm not sure why it throws, and trying to debug anything on AIX is too
painful for me to figure it out. Please report this to bugzilla,

More information about the Gcc-help mailing list