https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56973
Martin Sebor <msebor at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Last reconfirmed|2013-04-24 00:00:00 |2017-1-14 CC| |msebor at gcc dot gnu.org Known to fail| |6.3.0 --- Comment #3 from Martin Sebor <msebor at gcc dot gnu.org> --- I still see the crash with GCC 6 (the program runs fine when compiled with Clang). $ /build/gcc-6-branch/gcc/xg++ -B /build/gcc-6-branch/gcc -nostdinc++ -I /build/gcc-6-branch/x86_64-pc-linux-gnu/libstdc++-v3/include/x86_64-pc-linux-gnu -I /build/gcc-6-branch/x86_64-pc-linux-gnu/libstdc++-v3/include -I /src/gcc/6-branch/libstdc++-v3/libsupc++ -I /src/gcc/6-branch/libstdc++-v3/include/backward -I /src/gcc/6-branch/libstdc++-v3/testsuite/util -L /build/gcc-6-branch/x86_64-pc-linux-gnu/libstdc++-v3/src/.libs -O1 -g t.C && gdb -q -ex 'r e4 e4 e4' -ex bt -ex 'x/i $pc' -ex 'p $rdi' ./a.out Reading symbols from ./a.out...done. Starting program: /home/msebor/build/tmp/a.out e4 e4 e4 Program received signal SIGSEGV, Segmentation fault. 0x00007ffff7336266 in __strcmp_ssse3 () from /lib64/libc.so.6 #0 0x00007ffff7336266 in __strcmp_ssse3 () from /lib64/libc.so.6 #1 0x0000000000400656 in operator() (s=<optimized out>, __closure=<synthetic pointer>) at t.C:19 #2 operator() (s=<optimized out>, __closure=<synthetic pointer>) at t.C:25 #3 test (s=<optimized out>) at t.C:28 #4 0x0000000000400685 in main (argc=<optimized out>, argv=0x7fffffffdf38) at t.C:33 => 0x7ffff7336266 <__strcmp_ssse3+22>: movlpd (%rdi),%xmm1 $1 = 1 GCC 7 fails to compile the test case with the errors below: t.C: In lambda function: t.C:24:26: error: no matching function for call to ‘begin(const test(const char*)::<unnamed struct> [6])’ it=std::begin(ar); ^ In file included from /build/gcc-svn/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/range_access.h:36:0, from /build/gcc-svn/x86_64-pc-linux-gnu/libstdc++-v3/include/string:51, from /build/gcc-svn/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/locale_classes.h:40, from /build/gcc-svn/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/ios_base.h:41, from /build/gcc-svn/x86_64-pc-linux-gnu/libstdc++-v3/include/ios:42, from /build/gcc-svn/x86_64-pc-linux-gnu/libstdc++-v3/include/ostream:38, from /build/gcc-svn/x86_64-pc-linux-gnu/libstdc++-v3/include/iterator:64, from t.C:3: /src/gcc/svn/libstdc++-v3/libsupc++/initializer_list:89:5: note: candidate: template<class _Tp> constexpr const _Tp* std::begin(std::initializer_list<_Tp>) begin(initializer_list<_Tp> __ils) noexcept ^~~~~ /src/gcc/svn/libstdc++-v3/libsupc++/initializer_list:89:5: note: template argument deduction/substitution failed: t.C:24:26: note: mismatched types ‘std::initializer_list<_Tp>’ and ‘const test(const char*)::<unnamed struct>*’ it=std::begin(ar); ^ In file included from /build/gcc-svn/x86_64-pc-linux-gnu/libstdc++-v3/include/string:51:0, from /build/gcc-svn/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/locale_classes.h:40, from /build/gcc-svn/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/ios_base.h:41, from /build/gcc-svn/x86_64-pc-linux-gnu/libstdc++-v3/include/ios:42, from /build/gcc-svn/x86_64-pc-linux-gnu/libstdc++-v3/include/ostream:38, from /build/gcc-svn/x86_64-pc-linux-gnu/libstdc++-v3/include/iterator:64, from t.C:3: /build/gcc-svn/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/range_access.h:48:5: note: candidate: template<class _Container> decltype (__cont.begin()) std::begin(_Container&) begin(_Container& __cont) -> decltype(__cont.begin()) ^~~~~ /build/gcc-svn/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/range_access.h:48:5: note: template argument deduction/substitution failed: /build/gcc-svn/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/range_access.h: In substitution of ‘template<class _Container> decltype (__cont.begin()) std::begin(_Container&) [with _Container = const test(const char*)::<unnamed struct> [6]]’: t.C:24:26: required from here /build/gcc-svn/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/range_access.h:48:50: error: request for member ‘begin’ in ‘__cont’, which is of non-class type ‘const test(const char*)::<unnamed struct> [6]’ begin(_Container& __cont) -> decltype(__cont.begin()) ~~~~~~~^~~~~ /build/gcc-svn/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/range_access.h:58:5: note: candidate: template<class _Container> decltype (__cont.begin()) std::begin(const _Container&) begin(const _Container& __cont) -> decltype(__cont.begin()) ^~~~~ /build/gcc-svn/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/range_access.h:58:5: note: template argument deduction/substitution failed: /build/gcc-svn/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/range_access.h: In substitution of ‘template<class _Container> decltype (__cont.begin()) std::begin(const _Container&) [with _Container = test(const char*)::<unnamed struct> [6]]’: t.C:24:26: required from here /build/gcc-svn/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/range_access.h:58:56: error: request for member ‘begin’ in ‘__cont’, which is of non-class type ‘const test(const char*)::<unnamed struct> [6]’ begin(const _Container& __cont) -> decltype(__cont.begin()) ~~~~~~~^~~~~ /build/gcc-svn/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/range_access.h:87:5: note: candidate: _Tp* std::begin(_Tp (&)[_Nm]) [with _Tp = const test(const char*)::<unnamed struct>; long unsigned int _Nm = 6] begin(_Tp (&__arr)[_Nm]) ^~~~~ /build/gcc-svn/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/range_access.h:87:5: note: no known conversion for argument 1 from ‘const test(const char*)::<unnamed struct> [6]’ to ‘const test(const char*)::<unnamed struct> (&)[6]’