public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/54144] New: With -sdt=c++0x certain incorrect arguments to map.insert cause gcc crash
@ 2012-07-31 17:52 im_also_greg at yahoo dot com
2012-07-31 18:02 ` [Bug c++/54144] [4.6 Regression] With -std=c++0x " redi at gcc dot gnu.org
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: im_also_greg at yahoo dot com @ 2012-07-31 17:52 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54144
Bug #: 54144
Summary: With -sdt=c++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=27910
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, bailing
out
(full message pasted below)
#include <map>
#include <iostream>
int main(int argc, char *argv[]){
std::map <std::string,std::string> a_map;
a_map.insert("Hello","Hi");
}
Built with:
g++ -D__STDC_LIMIT_MACROS -std=c++0x -o test test2.cpp
System is: i386 Ubuntu 12.04. g++ pre-built in package build-essential.
gcc4.4 package is also installed on this machine.
Fixing the code is the work-around of course. Just submitting this (my first
ever) bug report in case it is useful.
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 ‘std::_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 = const
char&, _Key = std::basic_string<char>, _Val = std::pair<const
std::basic_string<char>, std::basic_string<char> >, _KeyOfValue =
std::_Select1st<std::pair<const std::basic_string<char>,
std::basic_string<char> > >, _Compare = std::less<std::basic_string<char> >,
_Alloc = std::allocator<std::pair<const std::basic_string<char>,
std::basic_string<char> > >, std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare,
_Alloc>::iterator = std::_Rb_tree_iterator<std::pair<const
std::basic_string<char>, std::basic_string<char> > >, std::_Rb_tree<_Key, _Val,
_KeyOfValue, _Compare, _Alloc>::const_iterator =
std::_Rb_tree_const_iterator<std::pair<const std::basic_string<char>,
std::basic_string<char> > >]’:
/usr/include/c++/4.6/bits/stl_tree.h:1466:4: instantiated from ‘void
std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_insert_unique(_II,
_II) [with _InputIterator = const char*, _Key = std::basic_string<char>, _Val =
std::pair<const std::basic_string<char>, std::basic_string<char> >, _KeyOfValue
= std::_Select1st<std::pair<const std::basic_string<char>,
std::basic_string<char> > >, _Compare = std::less<std::basic_string<char> >,
_Alloc = std::allocator<std::pair<const std::basic_string<char>,
std::basic_string<char> > >]’
/usr/include/c++/4.6/bits/stl_map.h:594:11: instantiated from ‘void
std::map<_Key, _Tp, _Compare, _Alloc>::insert(_InputIterator, _InputIterator)
[with _InputIterator = const char*, _Key = std::basic_string<char>, _Tp =
std::basic_string<char>, _Compare = std::less<std::basic_string<char> >, _Alloc
= std::allocator<std::pair<const std::basic_string<char>,
std::basic_string<char> > >]’
test2.cpp:7:28: instantiated from here
/usr/include/c++/4.6/bits/stl_tree.h:1335:4: error: no match for call to
‘(std::_Select1st<std::pair<const std::basic_string<char>,
std::basic_string<char> > >) (const char&)’
/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
= std::pair<const std::basic_string<char>, std::basic_string<char> >, typename
_Pair::first_type = const std::basic_string<char>]
/usr/include/c++/4.6/bits/stl_function.h:490:7: note: no known conversion for
argument 1 from ‘const char’ to ‘std::pair<const std::basic_string<char>,
std::basic_string<char> >&’
/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 = std::pair<const std::basic_string<char>, std::basic_string<char> >,
typename _Pair::first_type = const std::basic_string<char>]
/usr/include/c++/4.6/bits/stl_function.h:494:7: note: no known conversion for
argument 1 from ‘const char’ to ‘const std::pair<const std::basic_string<char>,
std::basic_string<char> >&’
/usr/include/c++/4.6/bits/stl_tree.h:1335: confused by earlier errors, bailing
out
Preprocessed source stored into /tmp/ccK6HImL.out file, please attach this to
your bugreport.
Thanks for gcc :)
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c++/54144] [4.6 Regression] With -std=c++0x certain incorrect arguments to map.insert cause gcc crash
2012-07-31 17:52 [Bug c++/54144] New: With -sdt=c++0x certain incorrect arguments to map.insert cause gcc crash im_also_greg at yahoo dot com
@ 2012-07-31 18:02 ` redi at gcc dot gnu.org
2012-08-16 11:06 ` rguenth at gcc dot gnu.org
2012-10-04 15:52 ` paolo.carlini at oracle dot com
2 siblings, 0 replies; 4+ messages in thread
From: redi at gcc dot gnu.org @ 2012-07-31 18:02 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54144
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |error-recovery,
| |ice-on-invalid-code
Status|UNCONFIRMED |NEW
Last reconfirmed| |2012-07-31
Known to work| |4.5.3, 4.7.1, 4.8.0
Summary|With -sdt=c++0x certain |[4.6 Regression] With
|incorrect arguments to |-std=c++0x certain
|map.insert cause gcc crash |incorrect arguments to
| |map.insert cause gcc crash
Ever Confirmed|0 |1
Known to fail| |4.6.3
--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-07-31 18:02:09 UTC ---
seems to be already fixed in the 4.7 branch and on trunk
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c++/54144] [4.6 Regression] With -std=c++0x certain incorrect arguments to map.insert cause gcc crash
2012-07-31 17:52 [Bug c++/54144] New: With -sdt=c++0x certain incorrect arguments to map.insert cause gcc crash im_also_greg at yahoo dot com
2012-07-31 18:02 ` [Bug c++/54144] [4.6 Regression] With -std=c++0x " redi at gcc dot gnu.org
@ 2012-08-16 11:06 ` rguenth at gcc dot gnu.org
2012-10-04 15:52 ` paolo.carlini at oracle dot com
2 siblings, 0 replies; 4+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-08-16 11:06 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54144
Richard Guenther <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |4.6.4
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c++/54144] [4.6 Regression] With -std=c++0x certain incorrect arguments to map.insert cause gcc crash
2012-07-31 17:52 [Bug c++/54144] New: With -sdt=c++0x certain incorrect arguments to map.insert cause gcc crash im_also_greg at yahoo dot com
2012-07-31 18:02 ` [Bug c++/54144] [4.6 Regression] With -std=c++0x " redi at gcc dot gnu.org
2012-08-16 11:06 ` rguenth at gcc dot gnu.org
@ 2012-10-04 15:52 ` paolo.carlini at oracle dot com
2 siblings, 0 replies; 4+ messages in thread
From: paolo.carlini at oracle dot com @ 2012-10-04 15:52 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54144
Paolo Carlini <paolo.carlini at oracle dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
--- Comment #2 from Paolo Carlini <paolo.carlini at oracle dot com> 2012-10-04 15:52:20 UTC ---
Confirmed already fixed.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-10-04 15:52 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-31 17:52 [Bug c++/54144] New: With -sdt=c++0x certain incorrect arguments to map.insert cause gcc crash im_also_greg at yahoo dot com
2012-07-31 18:02 ` [Bug c++/54144] [4.6 Regression] With -std=c++0x " redi at gcc dot gnu.org
2012-08-16 11:06 ` rguenth at gcc dot gnu.org
2012-10-04 15:52 ` paolo.carlini at oracle dot com
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).