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

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).