On 07/26/2015 12:09 AM, Roger Leigh wrote:
> On 25/07/2015 22:07, Roger Leigh wrote:
>> On 25/07/2015 21:45, Roger Leigh wrote:
>>
>>> OK, some further investigation has shown what the exact error is.  It
>>> looks like a GCC bug.  Please see the attached source file testcase.
>>> This regex is failing:
>>>
>>>    std::regex("^[a-z0-9][a-z0-9-]*$", std::regex::extended);
>>>
>>> however this one works:
>>>
>>>    std::regex("^[a-z0-9][-a-z0-9]*$", std::regex::extended);
>>
>> In the same vein, the attached sample using basic rather than extended
>> expressions fails in the opposite way. In this case both compile but the
>> latter expression fails to match correctly. Since the expression should
>> be valid and behave the same in both cases, it looks like there are two
>> bugs here, the first being unable to compile a valid extended regex, the
>> second here being unable to match (which is likely also a compile
>> failure, but not a fatal one).
> 
> Note this latter issue is seen with GCC 4.9 but appears to work with GCC 5.

now forwarded as https://gcc.gnu.org/PR67015

however I can't see different behaviour with 4.9 and 5 (making sure to use the
corresponding library using -static-libstdc++). Also I see regex2.cc always
succeeding.

$ cat run.sh
g++-4.8 -static-libstdc++ -std=c++0x regex.cc && ./a.out
g++-4.9 -static-libstdc++ -std=c++0x regex.cc && ./a.out
g++-5 -static-libstdc++ -std=c++0x regex.cc && ./a.out
/usr/lib/gcc-snapshot/bin/g++ -static-libstdc++ -std=c++0x regex.cc && ./a.out
clang++-3.5 -stdlib=libc++ -std=c++0x regex.cc && ./a.out
clang++-3.6 -stdlib=libc++ -std=c++0x regex.cc && ./a.out

g++-4.8 -static-libstdc++ -std=c++0x regex2.cc && ./a.out
g++-4.9 -static-libstdc++ -std=c++0x regex2.cc && ./a.out
g++-5 -static-libstdc++ -std=c++0x regex2.cc && ./a.out
/usr/lib/gcc-snapshot/bin/g++ -static-libstdc++ -std=c++0x regex2.cc && ./a.out
clang++-3.5 -stdlib=libc++ -std=c++0x regex2.cc && ./a.out
clang++-3.6 -stdlib=libc++ -std=c++0x regex2.cc && ./a.out

+ g++-4.8 -static-libstdc++ -std=c++0x regex.cc
+ ./a.out
E0: regex_error
a.out: regex.cc:24: int main(): Assertion `std::regex_match("test",
debian_cron_namespace)' failed.
Aborted (core dumped)
+ g++-4.9 -static-libstdc++ -std=c++0x regex.cc
+ ./a.out
E1: regex_error
+ g++-5 -static-libstdc++ -std=c++0x regex.cc
+ ./a.out
E1: regex_error
+ /usr/lib/gcc-snapshot/bin/g++ -static-libstdc++ -std=c++0x regex.cc
+ ./a.out
E1: regex_error
+ clang++-3.5 -stdlib=libc++ -std=c++0x regex.cc
+ ./a.out
+ clang++-3.6 -stdlib=libc++ -std=c++0x regex.cc
+ ./a.out
+ g++-4.8 -static-libstdc++ -std=c++0x regex2.cc
+ ./a.out
E0: regex_error
E1: regex_error
E2: regex_error
+ g++-4.9 -static-libstdc++ -std=c++0x regex2.cc
+ ./a.out
+ g++-5 -static-libstdc++ -std=c++0x regex2.cc
+ ./a.out
+ /usr/lib/gcc-snapshot/bin/g++ -static-libstdc++ -std=c++0x regex2.cc
+ ./a.out
+ clang++-3.5 -stdlib=libc++ -std=c++0x regex2.cc
+ ./a.out
+ clang++-3.6 -stdlib=libc++ -std=c++0x regex2.cc
+ ./a.out


-- 
To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to