[LLVMbugs] [Bug 19678] New: libc++ does not correctly handle the regex: "[^\\0]*"

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed May 7 10:20:57 PDT 2014


http://llvm.org/bugs/show_bug.cgi?id=19678

            Bug ID: 19678
           Summary: libc++ does not correctly handle the regex: "[^\\0]*"
           Product: libc++
           Version: unspecified
          Hardware: PC
                OS: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: All Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: william at lynch.us
                CC: llvmbugs at cs.uiuc.edu, mclow.lists at gmail.com
    Classification: Unclassified

Created attachment 12490
  --> http://llvm.org/bugs/attachment.cgi?id=12490&action=edit
Test Case

Hello,

This report is mostly forwarded from StackOverflow:
http://stackoverflow.com/questions/23484952

As far as I can tell, the following regular expression should be supported by
ECMA-262.

    std::regex regex("[^\\0]*");

I've attached a simple test case (which can also be seen at stackoverflow) and
I've included a few runs below:

Using Clang 3.4 with libstdc++ 4.9.0 on Centos 6.5, we have what I believe is
the correct behavior (that is, no output).

    > /opt/llvm/3.4/bin/clang++ -std=c++11 --gcc-toolchain=/opt/gcc/4.9.0
-Wl,-rpath=/opt/gcc/4.9.0/lib64 re.cc
    > ./a.out

We can also use G++ 4.9.0, but that's probably not very interesting. (It
reports no output as well):

    > /opt/gcc/4.9.0/bin/g++ -std=c++11 re.cc
    > ./a.out

On OS X (the only place I have libc++), We see the following:

    > clang++ -std=c++11 re.cc 
    > ./a.out 
    libc++abi.dylib: terminating with uncaught exception of type
std::__1::regex_error: The expression contained an invalid escaped character,
or a trailing escape.
    Abort

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20140507/d64ce46a/attachment.html>


More information about the llvm-bugs mailing list