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



             Bug #: 55856

           Summary: ICE on tuple with rvalue ref member

    Classification: Unclassified

           Product: gcc

           Version: 4.8.0

            Status: UNCONFIRMED

          Severity: normal

          Priority: P3

         Component: c++

        AssignedTo: unassig...@gcc.gnu.org

        ReportedBy: leo...@volnitsky.com





----------------------------------------------------------

#include <string>

#include <tuple>



std::tuple<int&&>               A{1};   // ok

std::string&&                   B{""};  // ok

std::tuple<std::string&&>       C{""};  // ICE

//int  main() {};

-----------------------------------------------------------



Code as shown have dangling rval ref to string&&  in C. 

But if we would build rvalue tuple, this would be valid code (temp string

should live with lifespan of initialization expressions).



Error message:





/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.0-pre9999/include/g++-v4/tuple:135:46:

internal compiler error: in build_data_member_initialization, at

cp/semantics.c:5853

  : _M_head_impl(std::forward<_UHead>(__h)) { }

                                              ^

Please submit a full bug report,

Reply via email to