https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85396

            Bug ID: 85396
           Summary: _M_t._M_emplace_hint_unique
           Product: gcc
           Version: 6.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: microprogs at mail dot ru
  Target Milestone: ---

Created attachment 43927
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=43927&action=edit
preprocessed test.cpp, you can see that src in comment, it's short

// gcc (Raspbian 6.3.0-18+rpi1+deb9u1) 6.3.0 20170516
// cat /etc/debian_version = 9.4
// Linux hostname 4.14.30-v7+ #1102 SMP Mon Mar 26 16:45:49 BST 2018 armv7l
GNU/Linux
// Raspberry Pi 3B
//
// C++11: ERROR, cannot compile
//g++ -std=c++11 -o test test.cpp
//
// C++14: OK
//g++ -std=c++14 -o test test.cpp
//
// old C++: OK
//g++ -o test test.cpp


#include <map>

struct MyType
{
    double x;
};

int main(int argc, char** argv)
{
    std::map<std::string, MyType> t;
    MyType &tss = t[""];
    return 0;
}

/*
ERROR:
In file included from /usr/include/c++/6/map:61:0,
                 from test.cpp:17:
/usr/include/c++/6/bits/stl_map.h: In member function ‘std::map<_Key, _Tp,
_Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare,
_Alloc>::operator[](std::map<_Key, _Tp, _Compare, _Alloc>::key_type&&) [with
_Key = std::__cxx11::basic_string<char>; _Tp = MyType; _Compare =
std::less<std::__cxx11::basic_string<char> >; _Alloc =
std::allocator<std::pair<const std::__cxx11::basic_string<char>, MyType> >]’:
/usr/include/c++/6/bits/stl_map.h:502:4: note: parameter passing for argument
of type ‘std::_Rb_tree<std::__cxx11::basic_string<char>, std::pair<const
std::__cxx11::basic_string<char>, MyType>, std::_Select1st<std::pair<const
std::__cxx11::basic_string<char>, MyType> >,
std::less<std::__cxx11::basic_string<char> >, std::allocator<std::pair<const
std::__cxx11::basic_string<char>, MyType> > >::const_iterator {aka
std::_Rb_tree_const_iterator<std::pair<const std::__cxx11::basic_string<char>,
MyType> >}’ will change in GCC 7.1
    __i = _M_t._M_emplace_hint_unique(__i, std::piecewise_construct,
    ^~~
In file included from /usr/include/c++/6/map:60:0,
                 from test.cpp:17:
/usr/include/c++/6/bits/stl_tree.h: In member function ‘std::_Rb_tree<_Key,
_Val, _KeyOfValue, _Compare, _Alloc>::iterator std::_Rb_tree<_Key, _Val,
_KeyOfValue, _Compare, _Alloc>::_M_emplace_hint_unique(std::_Rb_tree<_Key,
_Val, _KeyOfValue, _Compare, _Alloc>::const_iterator, _Args&& ...) [with _Args
= {const std::piecewise_construct_t&,
std::tuple<std::__cxx11::basic_string<char, std::char_traits<char>,
std::allocator<char> >&&>, std::tuple<>}; _Key =
std::__cxx11::basic_string<char>; _Val = std::pair<const
std::__cxx11::basic_string<char>, MyType>; _KeyOfValue =
std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, MyType> >;
_Compare = std::less<std::__cxx11::basic_string<char> >; _Alloc =
std::allocator<std::pair<const std::__cxx11::basic_string<char>, MyType> >]’:
/usr/include/c++/6/bits/stl_tree.h:2193:7: note: parameter passing for argument
of type ‘std::_Rb_tree<std::__cxx11::basic_string<char>, std::pair<const
std::__cxx11::basic_string<char>, MyType>, std::_Select1st<std::pair<const
std::__cxx11::basic_string<char>, MyType> >,
std::less<std::__cxx11::basic_string<char> >, std::allocator<std::pair<const
std::__cxx11::basic_string<char>, MyType> > >::const_iterator {aka
std::_Rb_tree_const_iterator<std::pair<const std::__cxx11::basic_string<char>,
MyType> >}’ will change in GCC 7.1
       _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/6/bits/stl_tree.h: In member function
‘std::pair<std::_Rb_tree_node_base*, std::_Rb_tree_node_base*>
std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare,
_Alloc>::_M_get_insert_hint_unique_pos(std::_Rb_tree<_Key, _Val, _KeyOfValue,
_Compare, _Alloc>::const_iterator, const key_type&) [with _Key =
std::__cxx11::basic_string<char>; _Val = std::pair<const
std::__cxx11::basic_string<char>, MyType>; _KeyOfValue =
std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, MyType> >;
_Compare = std::less<std::__cxx11::basic_string<char> >; _Alloc =
std::allocator<std::pair<const std::__cxx11::basic_string<char>, MyType> >]’:
/usr/include/c++/6/bits/stl_tree.h:1928:5: note: parameter passing for argument
of type ‘std::_Rb_tree<std::__cxx11::basic_string<char>, std::pair<const
std::__cxx11::basic_string<char>, MyType>, std::_Select1st<std::pair<const
std::__cxx11::basic_string<char>, MyType> >,
std::less<std::__cxx11::basic_string<char> >, std::allocator<std::pair<const
std::__cxx11::basic_string<char>, MyType> > >::const_iterator {aka
std::_Rb_tree_const_iterator<std::pair<const std::__cxx11::basic_string<char>,
MyType> >}’ will change in GCC 7.1
     _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

*/

Reply via email to