https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63199
Bug ID: 63199
Summary: Inserting std::wregex to std::vector looses some
std::wregex values
Product: gcc
Version: 4.9.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libstdc++
Assignee: unassigned at gcc dot gnu.org
Reporter: stefan at schweter dot it
Created attachment 33456
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33456&action=edit
Example program
Hi,
using GCC 4.9.1 I can reproduce a strange behavior with inserting
std::wregex values to a std::vector.
I'm using a loop which creates some std::wregex with imbuing and assigning.
After compiling and executing the program code, a core dump is returned.
Having a deeper look with gdb into the std::vector I can see, that only
the half of the std::wregex values have been properly inserted -> see
the _M_original_str variable.
Used GCC:
[root@098bff401751 /]# LC_MESSAGES=C g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.1/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: /build/gcc/src/gcc-4.9.1/configure --prefix=/usr
--libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man
--infodir=/usr/share/info --with-bugurl=https://bugs.archlinux.org/
--enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++ --enable-shared
--enable-threads=posix --with-system-zlib --enable-__cxa_atexit
--disable-libunwind-exceptions --enable-clocale=gnu --disable-libstdcxx-pch
--disable-libssp --enable-gnu-unique-object --enable-linker-build-id
--enable-cloog-backend=isl --disable-isl-version-check
--disable-cloog-version-check --enable-lto --enable-plugin
--enable-install-libiberty --with-linker-hash-style=gnu --disable-multilib
--disable-werror --enable-checking=release
Thread model: posix
gcc version 4.9.1 (GCC)
I compiled the program with:
g++ -g -std=c++11 std_regex.cpp
I also attached the example code and the gdb trace for the used regex_vector.