[Bug target/70464] New: [arch64] create a self hosting compiler
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70464 Bug ID: 70464 Summary: [arch64] create a self hosting compiler Product: gcc Version: 5.3.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: ge...@schorsch-tech.de Target Milestone: --- During our approach to get the raspberry pi3 and gentoo with an aarch64 kernel and userland running i tried to cross compile a "native compiler for aarch64". Our attempt succedded, as we got the userland cross compiled and the kernel. Both are running and seem to be ok, as far as we can tell currently. There is one core component for gentoo missing: The gcc. I tried to cross compile with the added cross compiler script. I used crossdev to create the amd64 to aarch64 cross compiler. With gcc 5.3.0 i could create a toolchain which runs on aarch64 but only supports C. No C++. You can download the folder here: https://www.schorsch-tech.de/rpi3/cross.tar.bz2 As i got this up, i tried to compile the aarch64 gcc with c++ on the raspberry pi but it failed at a for me very strange point: checking for unsigned long long int... yes checking for uintmax_t... yes checking for uintptr_t... yes checking for int64_t underlying type... long long configure: error: error verifying int64_t uses long long Makefile:4159: recipe for target 'configure-stage1-gcc' failed make[2]: *** [configure-stage1-gcc] Error 1 make[2]: Leaving directory '/var/tmp/portage/sys-devel/gcc-5.3.0/work/build' Makefile:19012: recipe for target 'stage1-bubble' failed make[1]: *** [stage1-bubble] Error 2 make[1]: Leaving directory '/var/tmp/portage/sys-devel/gcc-5.3.0/work/build' Makefile:19343: recipe for target 'bootstrap-lean' failed make: *** [bootstrap-lean] Error 2 With this compiler i could compile flex and bison which are a dependency to compile it with the gentoo tools. They seem both running. As i had this issue, i tried with the added script to get the gcc with c and c++ built. But it always failed at: In file included from /usr/aarch64-armv8a-linux-gnueabi/usr/include/stdio.h:936:0, from ../../../gcc-5.3.0/libitm/util.cc:27: /usr/aarch64-armv8a-linux-gnueabi/usr/include/bits/stdio2.h: In function 'void GTM::gtm_verror(const char*, va_list)': /usr/aarch64-armv8a-linux-gnueabi/usr/include/bits/stdio2.h:124:1: error: inlining failed in call to always_inline 'int vfprintf(FILE*, const char*, __gnuc_va_list)': function body can be overwritten at link time vfprintf (FILE *__restrict __stream, ^ ../../../gcc-5.3.0/libitm/util.cc:35:31: error: called from here vfprintf (stderr, fmt, list); ^ Makefile:517: recipe for target 'util.lo' failed make[4]: *** [util.lo] Error 1 I tried gcc 4.9.3 as cross chain and as target, 5.3.0 cross and target. But i failed All our attempts are documented in the gentoo forum. https://forums.gentoo.org/viewtopic-p-7899614.html#7899614
[Bug target/70464] [arch64] create a self hosting compiler
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70464 --- Comment #1 from ge...@schorsch-tech.de --- Created attachment 38136 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=38136&action=edit script to "cross compile the native compiler"
[Bug target/70464] [arch64] create a self hosting compiler
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70464 --- Comment #2 from ge...@schorsch-tech.de --- I also tried various target triplets aarch64-linux-gnu and aarch64-armv8a-linux-gnueabi. Nut as far as i know aarch64-linux-gnu is right.
[Bug target/70464] [arch64] create a self hosting compiler
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70464 --- Comment #3 from ge...@schorsch-tech.de --- I tried on the Raspberry pi 64 bit with the "C only gcc": Pi_3 64_bit ~ # cat main.c #include #include int main(int argc, char** argv) { printf("sizeof int64_t=%d\n",sizeof(int64_t)); return 0; } Pi_3 64_bit ~ # gcc main.c Pi_3 64_bit ~ # ./a.out sizeof int64_t=8 Pi_3 64_bit ~ # gcc --version gcc (GCC) 5.3.0 Copyright (C) 2015 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
[Bug target/70464] [arch64] create a self hosting compiler
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70464 --- Comment #4 from ge...@schorsch-tech.de --- Pi_3 64_bit ~ # grep int64_t /opt/cross/aarch64-linux-gnu/include/stdint.h typedef long intint64_t; typedef long long int int64_t; typedef unsigned long int uint64_t; typedef unsigned long long int uint64_t;
[Bug target/70464] [arch64] create a self hosting compiler
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70464 --- Comment #6 from ge...@schorsch-tech.de --- Created attachment 38137 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=38137&action=edit config log of the attempt to compile gcc on the raspberry pi3 This is the complete config.log of the attempt to build the native and complete gcc on the raspberry pi 3 using the gentoo tools and the "C only gcc"
[Bug target/70464] [arch64] create a self hosting compiler
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70464 --- Comment #7 from ge...@schorsch-tech.de --- (In reply to ktkachov from comment #5) > I usually use the target aarch64-none-linux-gnu, but aarch64-linux-gnu > should work too. > > Note that GCC requires a C++ compiler to build, so trying to use a C-only > compiler can't work. > > If I understand correctly, you want to build an aarch64-to-aarch64 compiler > on an x86_64-linux host, and you've only managed to do that for the C > frontend? > What was the gcc configure line passed to that build (by crossdev, or > whatever) > > Passing "-v" to the C-only gcc would give that information... Yes, you are right. I want on an amd64 host compile a "aarch64 to aarch64" compiler. This is the required information. Right from the target Pi_3 64_bit ~ # gcc -v Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/opt/cross/libexec/gcc/aarch64-linux-gnu/5.3.0/lto-wrapper Target: aarch64-linux-gnu Configured with: ../gcc-5.3.0/configure --prefix=/opt/cross --host=aarch64-linux-gnu --target=aarch64-linux-gnu --enable-languages=c --disable-multilib Thread model: posix gcc version 5.3.0 (GCC)
[Bug target/70464] [arch64] create a self hosting compiler
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70464 --- Comment #9 from ge...@schorsch-tech.de --- This is the previous result as i tried this: make[4]: Leaving directory '/home/georg/intern/Dokumente/Entwicklung/rpi3/src/gcc/build-gcc/aarch64-armv8a-linux-gnueabi/libitm/testsuite' make[4]: Entering directory '/home/georg/intern/Dokumente/Entwicklung/rpi3/src/gcc/build-gcc/aarch64-armv8a-linux-gnueabi/libitm' /bin/sh ./libtool --tag=CXX --mode=compile aarch64-armv8a-linux-gnueabi-c++ -B/home/georg/Dokumente/Entwicklung/rpi3/src/gcc/build-gcc/aarch64-armv8a-linux-gnueabi/libstdc++-v3/src/.libs -B/home/georg/Dokumente/Entwicklung/rpi3/src/gcc/build-gcc/aarch64-armv8a-linux-gnueabi/libstdc++-v3/libsupc++/.libs -DHAVE_CONFIG_H -I. -I../../../gcc-5.3.0/libitm -I../../../gcc-5.3.0/libitm/config/linux/aarch64 -I../../../gcc-5.3.0/libitm/config/linux -I../../../gcc-5.3.0/libitm/config/aarch64 -I../../../gcc-5.3.0/libitm/config/posix -I../../../gcc-5.3.0/libitm/config/generic -I../../../gcc-5.3.0/libitm -ftls-model=initial-exec -Wall -Werror -Wc,-pthread -std=gnu++0x -funwind-tables -fno-exceptions -fno-rtti -fabi-version=4 -g -O2 -D_GNU_SOURCE -MT util.lo -MD -MP -MF .deps/util.Tpo -c -o util.lo ../../../gcc-5.3.0/libitm/util.cc libtool: compile: aarch64-armv8a-linux-gnueabi-c++ -B/home/georg/Dokumente/Entwicklung/rpi3/src/gcc/build-gcc/aarch64-armv8a-linux-gnueabi/libstdc++-v3/src/.libs -B/home/georg/Dokumente/Entwicklung/rpi3/src/gcc/build-gcc/aarch64-armv8a-linux-gnueabi/libstdc++-v3/libsupc++/.libs -DHAVE_CONFIG_H -I. -I../../../gcc-5.3.0/libitm -I../../../gcc-5.3.0/libitm/config/linux/aarch64 -I../../../gcc-5.3.0/libitm/config/linux -I../../../gcc-5.3.0/libitm/config/aarch64 -I../../../gcc-5.3.0/libitm/config/posix -I../../../gcc-5.3.0/libitm/config/generic -I../../../gcc-5.3.0/libitm -ftls-model=initial-exec -Wall -pthread -Werror -std=gnu++0x -funwind-tables -fno-exceptions -fno-rtti -fabi-version=4 -g -O2 -D_GNU_SOURCE -MT util.lo -MD -MP -MF .deps/util.Tpo -c ../../../gcc-5.3.0/libitm/util.cc -fPIC -DPIC -o .libs/util.o In file included from /usr/aarch64-armv8a-linux-gnueabi/usr/include/stdio.h:936:0, from ../../../gcc-5.3.0/libitm/util.cc:27: /usr/aarch64-armv8a-linux-gnueabi/usr/include/bits/stdio2.h: In function 'void GTM::gtm_verror(const char*, va_list)': /usr/aarch64-armv8a-linux-gnueabi/usr/include/bits/stdio2.h:124:1: error: inlining failed in call to always_inline 'int vfprintf(FILE*, const char*, __gnuc_va_list)': function body can be overwritten at link time vfprintf (FILE *__restrict __stream, ^ ../../../gcc-5.3.0/libitm/util.cc:35:31: error: called from here vfprintf (stderr, fmt, list); ^ Makefile:517: recipe for target 'util.lo' failed Right now i compile the "aarch64-none-linux-gnu" "x64_64-to-aarch64" compiler to follow your advice as close as possible. When this is finished i try it again (with host and target aarch64-none-linux-gnu) and post the exact results + the exact configure line for the gcc.
[Bug target/70464] [arch64] create a self hosting compiler
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70464 --- Comment #10 from ge...@schorsch-tech.de --- Components to build the "aarch64-to-aarch64" gcc/g++: - sha1sum + filename f10c64e92d9c72ee428df3feaf349c4ecb2493bd binutils-2.25.tar.gz 2dc70313e8e2c6610b856d627bce9c9c3f848077 cloog-0.18.1.tar.gz 39ebff8a873181728b02db3689215557628eed9d gcc-5.3.0.tar.gz 5be95334f197121d8b351059a1c6518305d88e2a glibc-2.22.tar.xz 1aaf78358ab9e34aeb61f3ae08174ee9118ece98 gmp-6.0.0a.tar.xz c5a2b201bf05229647e73203c0bf2d9679d4d21f isl-0.16.1.tar.bz2 18d8e415f57a1fe4322faec441e45b6d2383b7d1 linux-4.5.tar.xz 5072d82ab50ec36cc8c0e320b5c377adb48abe70 mpc-1.0.2.tar.gz cedc0055d55b6ee4cd17e1e6119ed412520ff81a mpfr-3.1.4.tar.xz -- Used x86_64-to-aarch64 compiler (created with crossdev 20150716): georg@hammerhead ~ $ whereis aarch64-none-linux-gnu-gcc aarch64-none-linux-gnu-gcc: /usr/bin/aarch64-none-linux-gnu-gcc georg@hammerhead ~ $ file /usr/bin/aarch64-none-linux-gnu-gcc /usr/bin/aarch64-none-linux-gnu-gcc: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, stripped georg@hammerhead ~ $ /usr/bin/aarch64-none-linux-gnu-gcc -v Using built-in specs. COLLECT_GCC=/usr/x86_64-pc-linux-gnu/aarch64-none-linux-gnu/gcc-bin/5.3.0/aarch64-none-linux-gnu-gcc COLLECT_LTO_WRAPPER=/usr/libexec/gcc/aarch64-none-linux-gnu/5.3.0/lto-wrapper Target: aarch64-none-linux-gnu Configured with: /var/tmp/portage/cross-aarch64-none-linux-gnu/gcc-5.3.0/work/gcc-5.3.0/configure --host=x86_64-pc-linux-gnu --target=aarch64-none-linux-gnu --build=x86_64-pc-linux-gnu --prefix=/usr --bindir=/usr/x86_64-pc-linux-gnu/aarch64-none-linux-gnu/gcc-bin/5.3.0 --includedir=/usr/lib/gcc/aarch64-none-linux-gnu/5.3.0/include --datadir=/usr/share/gcc-data/aarch64-none-linux-gnu/5.3.0 --mandir=/usr/share/gcc-data/aarch64-none-linux-gnu/5.3.0/man --infodir=/usr/share/gcc-data/aarch64-none-linux-gnu/5.3.0/info --with-gxx-include-dir=/usr/lib/gcc/aarch64-none-linux-gnu/5.3.0/include/g++-v5 --with-python-dir=/share/gcc-data/aarch64-none-linux-gnu/5.3.0/python --enable-languages=c,c++,fortran --enable-obsolete --enable-secureplt --disable-werror --with-system-zlib --enable-nls --without-included-gettext --enable-checking=release --with-bugurl=https://bugs.gentoo.org/ --with-pkgversion='Gentoo 5.3.0 p1.0, pie-0.6.5' --enable-libstdcxx-time --enable-poison-system-directories --with-sysroot=/usr/aarch64-none-linux-gnu --disable-bootstrap --enable-__cxa_atexit --enable-clocale=gnu --disable-multilib --disable-altivec --disable-fixed-point --disable-libgcj --enable-libgomp --disable-libmudflap --disable-libssp --disable-libcilkrts --enable-lto --without-isl --enable-libsanitizer Thread model: posix gcc version 5.3.0 (Gentoo 5.3.0 p1.0, pie-0.6.5) Configure line for the "aarch64-to-aarch64" gcc: - ../gcc-5.3.0/configure --prefix=/opt/cross --host=aarch64-none-linux-gnu --target=aarch64-none-linux-gnu --enable-languages=c,c++ --disable-multilib Error message: -- libtool: compile: aarch64-none-linux-gnu-c++ -B/home/georg/Dokumente/Entwicklung/rpi3/src/gcc/build-gcc/aarch64-none-linux-gnu/libstdc++-v3/src/.libs -B/home/georg/Dokumente/Entwicklung/rpi3/src/gcc/build-gcc/aarch64-none-linux-gnu/libstdc++-v3/libsupc++/.libs -DHAVE_CONFIG_H -I. -I../../../gcc-5.3.0/libitm -I../../../gcc-5.3.0/libitm/config/linux/aarch64 -I../../../gcc-5.3.0/libitm/config/linux -I../../../gcc-5.3.0/libitm/config/aarch64 -I../../../gcc-5.3.0/libitm/config/posix -I../../../gcc-5.3.0/libitm/config/generic -I../../../gcc-5.3.0/libitm -ftls-model=initial-exec -Wall -pthread -Werror -std=gnu++0x -funwind-tables -fno-exceptions -fno-rtti -fabi-version=4 -g -O2 -D_GNU_SOURCE -MT util.lo -MD -MP -MF .deps/util.Tpo -c ../../../gcc-5.3.0/libitm/util.cc -fPIC -DPIC -o .libs/util.o In file included from /usr/aarch64-none-linux-gnu/usr/include/stdio.h:936:0, from ../../../gcc-5.3.0/libitm/util.cc:27: /usr/aarch64-none-linux-gnu/usr/include/bits/stdio2.h: In function 'void GTM::gtm_verror(const char*, va_list)': /usr/aarch64-none-linux-gnu/usr/include/bits/stdio2.h:124:1: error: inlining failed in call to always_inline 'int vfprintf(FILE*, const char*, __gnuc_va_list)': function body can be overwritten at link time vfprintf (FILE *__restrict __stream, ^ ../../../gcc-5.3.0/libitm/util.cc:35:31: error: called from here vfprintf (stderr, fmt, list); ^ Makefile:517: recipe for target 'util.lo' failed As the aarch64-none-linux-gnu-g++ executable got built but the libstdc++3 not, i copied the "partly done" destination folder to the raspberry pi 3 and here is the info about aar
[Bug target/70464] [arch64] create a self hosting compiler
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70464 --- Comment #12 from ge...@schorsch-tech.de --- I purged all temporary build data, added "--with-sysroot=/opt/aarch64-none-linux-gnu" to the configure line and rebuild again. The same error. /usr/aarch64-none-linux-gnu/usr/include/bits/stdio2.h: In function 'void GTM::gtm_verror(const char*, va_list)': /usr/aarch64-none-linux-gnu/usr/include/bits/stdio2.h:124:1: error: inlining failed in call to always_inline 'int vfprintf(FILE*, const char*, __gnuc_va_list)': function body can be overwritten at link time vfprintf (FILE *__restrict __stream, ^ ../../../gcc-5.3.0/libitm/util.cc:35:31: error: called from here vfprintf (stderr, fmt, list); ^ Makefile:517: recipe for target 'util.lo' failed
[Bug target/70464] [arch64] create a self hosting compiler
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70464 --- Comment #13 from ge...@schorsch-tech.de --- Now as i got a c++ compiler but no libstdc++ on the target, i try to use the gentoo tools to emerge (compile) the complete gcc on the target. Let it run over night whatever is needed. It is just a straw Any suggestions are welcome to build it. Regardless what i need to rebuild ...
[Bug target/70464] [arch64] create a self hosting compiler
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70464 --- Comment #14 from ge...@schorsch-tech.de --- Is it related to this? https://gcc.gnu.org/ml/gcc-patches/2013-04/msg00896.html
[Bug target/70464] [arch64] create a self hosting compiler
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70464 ge...@schorsch-tech.de changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution|--- |WORKSFORME --- Comment #15 from ge...@schorsch-tech.de --- A gentoo comunity member found the solution. It was related to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61164 The solution was found here: https://gcc.gnu.org/ml/gcc-patches/2014-09/msg02505.html
[Bug libstdc++/66359] New: Regex Fails to match
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66359 Bug ID: 66359 Summary: Regex Fails to match Product: gcc Version: 4.9.2 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: ge...@schorsch-tech.de Target Milestone: --- // #define USE_STD #ifdef USE_STD #include #else #include #endif #include #include #ifdef USE_STD namespace rx = std; #else namespace rx = boost; #endif int main(int argc, char* argv[]) { std::string line{ "Name:\tPiko_10_1 " }; rx::regex line_expression("^Name:\t {0,2}([a-zA-Z_0-9-]{1,20}) {0,20}$"); rx::match_results line_what; if (rx::regex_match(line, line_what, line_expression)) { std::cout << "Found it" << std::endl; } else { std::cout << "ERROR: Did not find it" << std::endl; return 1; } return 0; } Compile with: std: g++ --std=c++11 main.cpp -o test-std.exe Boost: g++ --std=c++11 main.cpp -o test-boost.exe -I PATH_TO_BOOST_INCLUDE _L PATH_TO_BOOST_REGEX_LIB I tried to convert an application from boost:.regex to std::regex. This example is the boiled down example from my application. With the define USE_STD defined, i get the error that this regex doesnt match. With boost::regex i get a match. I tried this regex on TDM-GCC-4.9.2 and on Linux gcc-4.9.2 (gentoo). I know regex is not implemented Prior 4.9.0. I am on 4.9.2 so i guess it should work. Other regexes like std::regex line_expression("([a-zA-Z_]+) ?= ?([a-zA-Z0-9./]+)"); work as expected.
[Bug libstdc++/66359] Regex Fails to match
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66359 --- Comment #1 from ge...@schorsch-tech.de --- The example main.cpp from abouve works on other Compilers like MSVC-2013 (VS12).
[Bug c++/59256] qualified name in friend function declaration doesn't match previous declaration in inline namespace
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59256 ge...@schorsch-tech.de changed: What|Removed |Added CC||ge...@schorsch-tech.de --- Comment #5 from ge...@schorsch-tech.de --- Created attachment 35665 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=35665&action=edit tried backport of 217461 to 4.9.2
[Bug c++/59256] qualified name in friend function declaration doesn't match previous declaration in inline namespace
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59256 --- Comment #6 from ge...@schorsch-tech.de --- ups ... wrong bug .. please delete that submitted patch
[Bug libstdc++/66359] Regex Fails to match
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66359 --- Comment #4 from ge...@schorsch-tech.de --- Created attachment 35666 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=35666&action=edit tried backport of 217461
[Bug libstdc++/66359] Regex Fails to match
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66359 --- Comment #3 from ge...@schorsch-tech.de --- I tried to apply that revision to gcc-4.9.2. Now i get the following error. g++ -DUSE_STD -std=c++11 main.cpp In file included from /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.2/include/g++-v4/regex:58:0, from main.cpp:2: /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.2/include/g++-v4/bits/regex.h:65:5: warning: inline function 'std::shared_ptr > std::__detail::__compile_nfa(const typename _TraitsT::char_type*, const typename _TraitsT::char_type*, const _TraitsT&, std::regex_constants::syntax_option_type) [with _TraitsT = std::regex_traits; typename _TraitsT::char_type = char]' used but never defined __compile_nfa(const typename _TraitsT::char_type* __first, ^ /tmp/ccMywN21.o: In function `std::basic_regex >::basic_regex(char const*, char const*, std::regex_constants::syntax_option_type)': main.cpp:(.text._ZNSt11basic_regexIcSt12regex_traitsIcEEC2IPKcEET_S6_NSt15regex_constants18syntax_option_typeE[_ZNSt11basic_regexIcSt12regex_traitsIcEEC5IPKcEET_S6_NSt15regex_constants18syntax_option_typeE]+0xd5): undefined reference to `std::shared_ptr > > std::__detail::__compile_nfa >(std::regex_traits::char_type const*, std::regex_traits::char_type const*, std::regex_traits const&, std::regex_constants::syntax_option_type)' collect2: error: ld returned 1 exit status I added my applied patch too. I copied the files from your revision to my tree and used git to create that patch.
[Bug c++/68032] New: std-c++-14: Regex fails to match
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68032 Bug ID: 68032 Summary: std-c++-14: Regex fails to match Product: gcc Version: 5.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: ge...@schorsch-tech.de Target Milestone: --- I try to parse some data files and check the data with regex. During the parse it fails on some lines. I reduced the code to the following. #include #include #include int main(int argc, char** argv) { std::string data = " data(C96) = { 96, 1000, 15000, 6400, 6470, 0, 0, 7490, 8000, 1000, 1, 10, 0 };"; auto ex0 = std::regex("data\\(([a-zA-Z0-9_-]+)\\) ?= ?\\{ ?([0-9+]), ?([0-9]+), ?([0-9]+), ?([0-9]+), ?([0-9]+), ?([0-9]+), ?([0-9]+), ?([0-9]+), ?([0-9]+), ?([0-9]+), ?([0-9]+), ?([0-9]+), ?([0-9]+) ?\\};"); std::smatch what; if (std::regex_search(data, what, ex0)) { std::cout << "Matched" << std::endl; } else { std::cout << "FAIL" << std::endl; } } Compile it with g++ --std=c++14 main.cpp -o test run it: ./test Result: FAIL: Expected: Matched g++ --version g++ (Gentoo 5.2.0 p1.2, pie-0.6.4) 5.2.0 Copyright (C) 2015 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
[Bug libstdc++/68032] std-c++-14: Regex fails to match
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68032 ge...@schorsch-tech.de changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution|--- |INVALID --- Comment #2 from ge...@schorsch-tech.de --- Hello Tim, yes, you are right! Now it works as expected. In fact i'm happy that it was such an error.