[Bug c++/85732] New: use_facet>(mylocale) retrieving wrong locale information

2018-05-10 Thread gnu-org at bignm dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85732

Bug ID: 85732
   Summary: use_facet>(mylocale) retrieving
wrong locale information
   Product: gcc
   Version: 6.4.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gnu-org at bignm dot com
  Target Milestone: ---

Created attachment 44110
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=44110&action=edit
Source code and test output results showing error

Dear Bug Team,

I just recently upgraded using "apt" my Ubuntu 16.04 system and gcc was
upgraded from 6.2.0 to 6.4.0 which introduced the following bug.

In the attached archive is a program "testlocale.cpp" which requires only
gcc-supplied  header files. The command line to compile it and execute it is in
the comments at the top of the file.

In essence, it tests each facet of three locales (on my system "en_US.utf8",
"pt_BR.utf8" and "C" locales. All worked perfectly in g++ 6.2.0. As of g++
6.4.0, all of the facets, except the "moneypunct" facet work properly (see line
134).

Here is my information:

Linux version
$ uname -a
Linux asusubuntu16 4.13.0-41-generic #46~16.04.1-Ubuntu SMP Thu May 3 10:06:43
UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

Compiler version
$ gcc --version
gcc (Ubuntu 5.5.0-12ubuntu1~16.04) 5.5.0 20171010
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Compile command:
$ g++ -std=c++14 -m64 testlocale.cpp -static -o testlocale

Run command:
$ ./testlocale > testlocale.out

Attached is a test output generated by gcc 6.4.0 on my system. Of course, you
can test it on your system yourself and try to duplicate the error.

Best regards,
Tom Straub

[Bug c++/85732] use_facet>(mylocale) retrieving wrong locale information

2018-05-10 Thread gnu-org at bignm dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85732

--- Comment #1 from Tom Straub  ---
Sorry, wrong compiler included in post, here is the right one:

$ g++ --version
g++ (Ubuntu 6.4.0-17ubuntu1~16.04) 6.4.0 20180424
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

[Bug libstdc++/85732] use_facet>(mylocale) retrieving wrong locale information

2018-05-10 Thread gnu-org at bignm dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85732

--- Comment #5 from Tom Straub  ---
Hi Johnathon,

Okay, thanks for confirming. I didn't realize it was such as old bug. You're
right, I just recently switched over to using -static (got tired of the library
mismatches with multiple gcc versions on my system).

Best, Tom

[Bug libstdc++/85732] use_facet>(mylocale) retrieving wrong locale information

2018-05-10 Thread gnu-org at bignm dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85732

--- Comment #7 from Tom Straub  ---
Hi Jonathan,

Thanks for really tracking that down. Looks like a really deep and subtle bug.
I hope somebody knows where to look to fix it in the glibc code.

Best, Tom

[Bug libstdc++/63776] [C++11] Regex collate matching not working

2015-01-20 Thread gnu-org at bignm dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63776

--- Comment #5 from Tom Straub  ---
Created attachment 34497
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=34497&action=edit
Test Program for UTF-8 CPP library


[Bug libstdc++/63776] [C++11] Regex collate matching not working

2015-01-20 Thread gnu-org at bignm dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63776

--- Comment #6 from Tom Straub  ---
Hi Tim,

After banging my head against the wall looking for a solution to the C++11
UTF-8 support problems, I finally found what seems to be a great addition to my
project, which I think might be beneficial to GNU as well.

It is the UTF-8 CPP code. It is implemented as a header file, so there are no
linking issues involved. It seems to add all the functionality needed that
seems to be missing in GCC currently.

The project can be found at:  http://sourceforge.net/projects/utfcpp/

It would certainly make implementation of the codecvt stuff less painful.

Best, Tom


[Bug c++/63775] New: [C++11] Regex range with leading dash (-) not working

2014-11-07 Thread gnu-org at bignm dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63775

Bug ID: 63775
   Summary: [C++11] Regex range with leading dash (-) not working
   Product: gcc
   Version: 4.9.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gnu-org at bignm dot com

Created attachment 33918
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33918&action=edit
Source code of test program

Partial output from file below:

Note the String below should match the Regexp. Full source code of the test
program is attached below.

DEBUG: test_group(): String = 'module_method'
DEBUG: test_group(): Regexp = '/^([-a-z0-9]+)_([-a-z0-9]+)$/o'
DEBUG: group_regexp(): Using 'o' flag
DEBUG: group_regexp(): Match Failed!
DEBUG: test_group(): First match in 0.000753880 seconds
DEBUG: test_group(): First match failed!
DEBUG: group_regexp(): Using 'o' flag
DEBUG: group_regexp(): Match Failed!
DEBUG: test_group(): Second match in 0.000759125 seconds
DEBUG: test_group(): Second match failed!


[Bug c++/63776] New: [C++11] Regex collate matching not working

2014-11-07 Thread gnu-org at bignm dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63776

Bug ID: 63776
   Summary: [C++11] Regex collate matching not working
   Product: gcc
   Version: 4.9.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gnu-org at bignm dot com

Created attachment 33919
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33919&action=edit
Full test program source code

The locale has been set to "pt_BR.UTF-8" and the following String should match
the Regexp passed to the group_regexp() function. It seems as if the collation
matching is not working.

String = "João Méroço" 
DEBUG: group_regexp(): Using 'c' flag
DEBUG: group_regexp(): Using 'o' flag
DEBUG: group_regexp(): Match Failed!
group_regexp('/("[[:alpha:][:space:]]+")/co') returned failure!

Full test program source code is attached below.

[Bug libstdc++/63776] [C++11] Regex collate matching not working

2014-11-08 Thread gnu-org at bignm dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63776

--- Comment #2 from Tom Straub  ---
Hi Tim,

Okay, a program very similar to this using the Boost REGEX library and ICU 4.55
works just fine with this.

According to my understanding, the "char" data type and "std::string" classes
were specifically set up in C++11 to handle UTF-8 sequences.

The "sequence of bytes" are actually valid UNICODE characters. So, there should
be no problem, that is, if the std::regex_constants::collate flag is actually
working, since the application is using  and setting the std::locale to
"pt_BR.UTF-8" (which is supported on my box).

It is acting as if it is still in POSIX or C locale, since it doesn't recognize
the accented characters as "[:alpha:]" class.

Here is my G++ version:

$ g++ --version
g++ (GCC) 4.9.1
Copyright (C) 2014 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Tom


[Bug libstdc++/63776] [C++11] Regex collate matching not working

2014-11-08 Thread gnu-org at bignm dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63776

--- Comment #3 from Tom Straub  ---
Hi Tim,

OOPS! The versions used were Boost REGEX 1.55.0 and ICU 52. Got the versions
mixed up in my head.

Tom