http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57047

             Bug #: 57047
           Summary: [C++11] stl_pair.h:137:64: internal compiler error:
                    Segmentation fault in constexpr constructor
    Classification: Unclassified
           Product: gcc
           Version: 4.7.2
            Status: UNCONFIRMED
          Severity: blocker
          Priority: P3
         Component: libstdc++
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: mattyclark...@gmail.com


template<class _U1, class _U2, class = typename
       enable_if<__and_<is_convertible<_U1, _T1>,
      is_convertible<_U2, _T2>>::value>::type>
constexpr pair(_U1&& __x, _U2&& __y)
: first(std::forward<_U1>(__x)), second(std::forward<_U2>(__y)) { }

Fails for my program when compiled with the following command line:

/usr/lib64/ccache/g++ -m64 -std=c++11 -Wall -Wextra -pedantic -pthread -flto
-DNDEBUG -O3 -Werror -pedantic-errors -fvisibility=hidden
-fvisibility-inlines-hidden -I/home/matt/svn/KS/lib
-I/home/matt/svn/KS/build/release/lib -I/home/matt/svn/KS/build/release/include
-I/home/matt/svn/KS/include -I/usr/include ../../lib/messaging/tests/task.cpp
-c -o lib/messaging/tests/task.cpp.4.o

With the following error:

In file included from
/usr/lib/gcc/x86_64-redhat-linux/4.7.2/../../../../include/c++/4.7.2/bits/stl_algobase.h:65:0,
                 from
/usr/lib/gcc/x86_64-redhat-linux/4.7.2/../../../../include/c++/4.7.2/bits/char_traits.h:41,
                 from
/usr/lib/gcc/x86_64-redhat-linux/4.7.2/../../../../include/c++/4.7.2/string:42,
                 from
/usr/lib/gcc/x86_64-redhat-linux/4.7.2/../../../../include/c++/4.7.2/stdexcept:40,
                 from ../../lib/messaging/tests/task.cpp:15:
/usr/lib/gcc/x86_64-redhat-linux/4.7.2/../../../../include/c++/4.7.2/bits/stl_pair.h:
In instantiation of ‘constexpr std::pair<_T1, _T2>::pair(_U1&&, _U2&&) [with
_U1 = const char (&)[35]; _U2 = const char (&)[11]; <template-parameter-2-3> =
void; _T1 = udp::ks::messaging::Id; _T2 = udp::ks::messaging::Id]’:
../../lib/messaging/tests/task.cpp:371:7:   required from here
/usr/lib/gcc/x86_64-redhat-linux/4.7.2/../../../../include/c++/4.7.2/bits/stl_pair.h:137:64:
  in constexpr expansion of ‘((std::pair<udp::ks::messaging::Id,
udp::ks::messaging::Id>*)this)->std::pair<udp::ks::messaging::Id,
udp::ks::messaging::Id>::first.udp::ks::messaging::Id::Id(((const
char*)std::forward<const char (&)[35]>((* & __x))))’
/home/matt/svn/KS/include/udp/keystone/messaging/id.hpp:260:30:   in constexpr
expansion of ‘udp::ks::messaging::Name::Validate(((const Char*)string))’
/usr/lib/gcc/x86_64-redhat-linux/4.7.2/../../../../include/c++/4.7.2/bits/stl_pair.h:137:64:
internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://bugzilla.redhat.com/bugzilla> for instructions.
Preprocessed source stored into /tmp/cc99Hnms.out file, please attach this to
your bugreport.

Have attached the preprocessed output.

Reply via email to