public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/52719] New: C++11 std::regex is broken compiling simple regular expressions
@ 2012-03-26  8:29 rleigh at debian dot org
  2012-03-26  8:31 ` [Bug libstdc++/52719] " rleigh at debian dot org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: rleigh at debian dot org @ 2012-03-26  8:29 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52719

             Bug #: 52719
           Summary: C++11 std::regex is broken compiling simple regular
                    expressions
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: rleigh@debian.org


Created attachment 26991
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=26991
Working code using boost::regex

This is reproducible with both GCC 4.6 and 4.7.

Simple expressions such as "^[^:/,.][^:/,]*$" result in a regex_error exception
being thrown.  The exception what() method returns only "regex_error", rather
than any informative message.  The code previously used boost::regex, which
worked perfectly well.  The same regex also works with grep.

I've attached:
- working boost code
- failing std::regex code
- compiler info
- g++ -E output

The gdb backtrace is as follows:

% gdb testr
GNU gdb (GDB) 7.4-debian
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/rleigh/schroot/testr...(no debugging symbols
found)...done.
(gdb) catch throw
Function "__cxa_throw" not defined.
Catchpoint 1 (throw)
(gdb) run
Starting program: /home/rleigh/schroot/testr
Catchpoint 1 (exception thrown), 0x000000319f862800 in __cxa_throw ()
   from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
(gdb) bt
#0  0x000000319f862800 in __cxa_throw ()
   from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#1  0x000000319f8b5a9d in
std::__throw_regex_error(std::regex_constants::error_type) () from
/usr/lib/x86_64-linux-gnu/libstdc++.so.6
#2  0x0000000000408bac in std::__regex::_Compiler<char const*,
std::regex_traits<char> >::_M_bracket_expression() ()
#3  0x0000000000407db3 in std::__regex::_Compiler<char const*,
std::regex_traits<char> >::_M_atom() ()
#4  0x0000000000406db5 in std::__regex::_Compiler<char const*,
std::regex_traits<char> >::_M_term() ()
#5  0x0000000000405a28 in std::__regex::_Compiler<char const*,
std::regex_traits<char> >::_M_alternative() ()
#6  0x0000000000405a72 in std::__regex::_Compiler<char const*,
std::regex_traits<char> >::_M_alternative() ()
#7  0x0000000000404d38 in std::__regex::_Compiler<char const*,
std::regex_traits<char> >::_M_disjunction() ()
#8  0x00000000004042ed in std::__regex::_Compiler<char const*,
std::regex_traits<char> >::_Compiler(char const* const&, char const* const&,
std::regex_traits<char>&, unsigned int) ()
#9  0x00000000004037e9 in std::shared_ptr<std::__regex::_Automaton>
std::__regex::__compile<char const*, std::regex_traits<char> >(char const*
const&, char const* const&, std::regex_traits<char>&, unsigned int) ()
#10 0x0000000000402e89 in std::basic_regex<char, std::regex_traits<char>
>::basic_regex(char const*, unsigned int) ()
#11 0x0000000000401b16 in main ()


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug libstdc++/52719] C++11 std::regex is broken compiling simple regular expressions
  2012-03-26  8:29 [Bug libstdc++/52719] New: C++11 std::regex is broken compiling simple regular expressions rleigh at debian dot org
@ 2012-03-26  8:31 ` rleigh at debian dot org
  2012-03-26  8:32 ` rleigh at debian dot org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: rleigh at debian dot org @ 2012-03-26  8:31 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52719

--- Comment #1 from Roger Leigh <rleigh at debian dot org> 2012-03-26 08:29:23 UTC ---
Created attachment 26992
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=26992
Failing code using std::regex


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug libstdc++/52719] C++11 std::regex is broken compiling simple regular expressions
  2012-03-26  8:29 [Bug libstdc++/52719] New: C++11 std::regex is broken compiling simple regular expressions rleigh at debian dot org
  2012-03-26  8:31 ` [Bug libstdc++/52719] " rleigh at debian dot org
@ 2012-03-26  8:32 ` rleigh at debian dot org
  2012-03-26  8:37 ` rleigh at debian dot org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: rleigh at debian dot org @ 2012-03-26  8:32 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52719

--- Comment #2 from Roger Leigh <rleigh at debian dot org> 2012-03-26 08:31:09 UTC ---
Created attachment 26993
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=26993
Preprocessed std::regex source (g++ -E)


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug libstdc++/52719] C++11 std::regex is broken compiling simple regular expressions
  2012-03-26  8:29 [Bug libstdc++/52719] New: C++11 std::regex is broken compiling simple regular expressions rleigh at debian dot org
  2012-03-26  8:31 ` [Bug libstdc++/52719] " rleigh at debian dot org
  2012-03-26  8:32 ` rleigh at debian dot org
@ 2012-03-26  8:37 ` rleigh at debian dot org
  2012-03-26  8:41 ` rleigh at debian dot org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: rleigh at debian dot org @ 2012-03-26  8:37 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52719

--- Comment #3 from Roger Leigh <rleigh at debian dot org> 2012-03-26 08:31:48 UTC ---
Created attachment 26994
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=26994
Machine and compiler specs


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug libstdc++/52719] C++11 std::regex is broken compiling simple regular expressions
  2012-03-26  8:29 [Bug libstdc++/52719] New: C++11 std::regex is broken compiling simple regular expressions rleigh at debian dot org
                   ` (2 preceding siblings ...)
  2012-03-26  8:37 ` rleigh at debian dot org
@ 2012-03-26  8:41 ` rleigh at debian dot org
  2012-03-26 10:08 ` redi at gcc dot gnu.org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: rleigh at debian dot org @ 2012-03-26  8:41 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52719

--- Comment #4 from Roger Leigh <rleigh at debian dot org> 2012-03-26 08:37:10 UTC ---
I left the priority as "normal", but if this is generally reproducible, and not
a failure on my part, it would mean that std::regex is quite unusable in its
current form.

Thanks,
Roger


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug libstdc++/52719] C++11 std::regex is broken compiling simple regular expressions
  2012-03-26  8:29 [Bug libstdc++/52719] New: C++11 std::regex is broken compiling simple regular expressions rleigh at debian dot org
                   ` (3 preceding siblings ...)
  2012-03-26  8:41 ` rleigh at debian dot org
@ 2012-03-26 10:08 ` redi at gcc dot gnu.org
  2012-06-11  8:36 ` redi at gcc dot gnu.org
  2013-02-19 20:38 ` LpSolit at netscape dot net
  6 siblings, 0 replies; 8+ messages in thread
From: redi at gcc dot gnu.org @ 2012-03-26 10:08 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52719

--- Comment #5 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-03-26 09:47:12 UTC ---
(In reply to comment #4)
> std::regex is quite unusable in its current form.

And documented as such in
http://gcc.gnu.org/onlinedocs/libstdc++/manual/status.html#status.iso.2011

The whole of Clause 28 is partially supported or not supported at all.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug libstdc++/52719] C++11 std::regex is broken compiling simple regular expressions
  2012-03-26  8:29 [Bug libstdc++/52719] New: C++11 std::regex is broken compiling simple regular expressions rleigh at debian dot org
                   ` (4 preceding siblings ...)
  2012-03-26 10:08 ` redi at gcc dot gnu.org
@ 2012-06-11  8:36 ` redi at gcc dot gnu.org
  2013-02-19 20:38 ` LpSolit at netscape dot net
  6 siblings, 0 replies; 8+ messages in thread
From: redi at gcc dot gnu.org @ 2012-06-11  8:36 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52719

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |DUPLICATE

--- Comment #6 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-06-11 08:36:34 UTC ---
.

*** This bug has been marked as a duplicate of bug 53631 ***


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug libstdc++/52719] C++11 std::regex is broken compiling simple regular expressions
  2012-03-26  8:29 [Bug libstdc++/52719] New: C++11 std::regex is broken compiling simple regular expressions rleigh at debian dot org
                   ` (5 preceding siblings ...)
  2012-06-11  8:36 ` redi at gcc dot gnu.org
@ 2013-02-19 20:38 ` LpSolit at netscape dot net
  6 siblings, 0 replies; 8+ messages in thread
From: LpSolit at netscape dot net @ 2013-02-19 20:38 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52719

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |DUPLICATE

--- Comment #6 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-06-11 08:36:34 UTC ---
.

*** This bug has been marked as a duplicate of bug 53631 ***


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2013-02-19 20:37 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-26  8:29 [Bug libstdc++/52719] New: C++11 std::regex is broken compiling simple regular expressions rleigh at debian dot org
2012-03-26  8:31 ` [Bug libstdc++/52719] " rleigh at debian dot org
2012-03-26  8:32 ` rleigh at debian dot org
2012-03-26  8:37 ` rleigh at debian dot org
2012-03-26  8:41 ` rleigh at debian dot org
2012-03-26 10:08 ` redi at gcc dot gnu.org
2012-06-11  8:36 ` redi at gcc dot gnu.org
2013-02-19 20:38 ` LpSolit at netscape dot net

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).