From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24397 invoked by alias); 31 Jul 2012 17:52:24 -0000 Received: (qmail 24382 invoked by uid 22791); 31 Jul 2012 17:52:21 -0000 X-SWARE-Spam-Status: No, hits=-3.6 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 31 Jul 2012 17:52:08 +0000 From: "im_also_greg at yahoo dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/54144] New: With -sdt=c++0x certain incorrect arguments to map.insert cause gcc crash Date: Tue, 31 Jul 2012 17:52:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Keywords: X-Bugzilla-Severity: minor X-Bugzilla-Who: im_also_greg at yahoo dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2012-07/txt/msg02274.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D54144 Bug #: 54144 Summary: With -sdt=3Dc++0x certain incorrect arguments to map.insert cause gcc crash Classification: Unclassified Product: gcc Version: 4.6.3 Status: UNCONFIRMED Severity: minor Priority: P3 Component: c++ AssignedTo: unassigned@gcc.gnu.org ReportedBy: im_also_greg@yahoo.com Created attachment 27910 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=3D27910 Preprocessor output This incorrect code causes gcc to crash with a message ending: ... /usr/include/c++/4.6/bits/stl_tree.h:1335: confused by earlier errors, bail= ing out (full message pasted below) #include #include int main(int argc, char *argv[]){ std::map a_map; a_map.insert("Hello","Hi"); } Built with: g++ -D__STDC_LIMIT_MACROS -std=3Dc++0x -o test test2.cpp System is: i386 Ubuntu 12.04. g++ pre-built in package build-essential.=20 gcc4.4 package is also installed on this machine. Fixing the code is the work-around of course. Just submitting this (my fir= st ever) bug report in case it is useful.=20=20 Preprocessor output is attached. Full error message: greghale@jellyroll:~/arte-ephys/src/test/convert_config_to_proto$ ./build.sh In file included from /usr/include/c++/4.6/map:60:0, from test2.cpp:1: /usr/include/c++/4.6/bits/stl_tree.h: In member function =E2=80=98std::_Rb_= tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_insert_unique_(std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::const_iterator, _Arg&&) [with _Arg =3D const char&, _Key =3D std::basic_string, _Val =3D std::pair, std::basic_string >, _KeyOfValue =3D std::_Select1st, std::basic_string > >, _Compare =3D std::less= >, _Alloc =3D std::allocator, std::basic_string > >, std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compar= e, _Alloc>::iterator =3D std::_Rb_tree_iterator, std::basic_string > >, std::_Rb_tree<_Key, _= Val, _KeyOfValue, _Compare, _Alloc>::const_iterator =3D std::_Rb_tree_const_iterator, std::basic_string > >]=E2=80=99: /usr/include/c++/4.6/bits/stl_tree.h:1466:4: instantiated from =E2=80=98v= oid std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_insert_unique(= _II, _II) [with _InputIterator =3D const char*, _Key =3D std::basic_string= , _Val =3D std::pair, std::basic_string >, _KeyOfV= alue =3D std::_Select1st, std::basic_string > >, _Compare =3D std::less= >, _Alloc =3D std::allocator, std::basic_string > >]=E2=80=99 /usr/include/c++/4.6/bits/stl_map.h:594:11: instantiated from =E2=80=98vo= id std::map<_Key, _Tp, _Compare, _Alloc>::insert(_InputIterator, _InputIterato= r) [with _InputIterator =3D const char*, _Key =3D std::basic_string, _Tp= =3D std::basic_string, _Compare =3D std::less >, = _Alloc =3D std::allocator, std::basic_string > >]=E2=80=99 test2.cpp:7:28: instantiated from here /usr/include/c++/4.6/bits/stl_tree.h:1335:4: error: no match for call to =E2=80=98(std::_Select1st, std::basic_string > >) (const char&)=E2=80=99 /usr/include/c++/4.6/bits/stl_function.h:486:12: note: candidates are: /usr/include/c++/4.6/bits/stl_function.h:490:7: note: typename _Pair::first_type& std::_Select1st<_Pair>::operator()(_Pair&) const [with _= Pair =3D std::pair, std::basic_string >, typ= ename _Pair::first_type =3D const std::basic_string] /usr/include/c++/4.6/bits/stl_function.h:490:7: note: no known conversion= for argument 1 from =E2=80=98const char=E2=80=99 to =E2=80=98std::pair, std::basic_string >&=E2=80=99 /usr/include/c++/4.6/bits/stl_function.h:494:7: note: const typename _Pair::first_type& std::_Select1st<_Pair>::operator()(const _Pair&) const [= with _Pair =3D std::pair, std::basic_string = >, typename _Pair::first_type =3D const std::basic_string] /usr/include/c++/4.6/bits/stl_function.h:494:7: note: no known conversion= for argument 1 from =E2=80=98const char=E2=80=99 to =E2=80=98const std::pair, std::basic_string >&=E2=80=99 /usr/include/c++/4.6/bits/stl_tree.h:1335: confused by earlier errors, bail= ing out Preprocessed source stored into /tmp/ccK6HImL.out file, please attach this = to your bugreport. Thanks for gcc :)