https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67015

            Bug ID: 67015
           Summary: "^[a-z0-9][a-z0-9-]*$", std::regex::extended is
                    miscompiled
           Product: gcc
           Version: 5.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: doko at gcc dot gnu.org
  Target Milestone: ---

Created attachment 36055
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=36055&action=edit
regex.cc

[forwarded from https://bugs.debian.org/778112]

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

I'm unable to reproduce the claim in the original bug report with regex2.cc.

$ 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

Reply via email to