This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
internal compiler error in gcc trunk when using std::map
- From: Nathan Ridge <zeratul976 at hotmail dot com>
- To: GCC Mailing List <gcc at gcc dot gnu dot org>
- Date: Fri, 10 Dec 2010 00:40:56 +0000
- Subject: internal compiler error in gcc trunk when using std::map
Hello,
I've just build the gcc trunk and tried to compile some code that compiled fine with gcc 4.5.
It gave an internal compiler error.
I've reduced it to the following minimal test case:
#include <string>
#include <map>
int main()
{
std::map<std::string, int> m;
std::pair<std::string, int> p;
m.insert(p);
return 0;
}
Here's the command used to compile:
g++-4.6 --std=c++0x test.cpp
Here's the output:
In file included from /usr/local/lib/gcc/i686-pc-linux-gnu/4.6.0/../../../../include/c++/4.6.0/bits/stl_algobase.h:65:0,
from /usr/local/lib/gcc/i686-pc-linux-gnu/4.6.0/../../../../include/c++/4.6.0/bits/char_traits.h:41,
from /usr/local/lib/gcc/i686-pc-linux-gnu/4.6.0/../../../../include/c++/4.6.0/string:42,
from ice.cpp:1:
/usr/local/lib/gcc/i686-pc-linux-gnu/4.6.0/../../../../include/c++/4.6.0/bits/stl_pair.h: In constructor âconstexpr std::pair<_T1, _T2>::pair(const std::pair<_U1, _U2>&) [with _U1 = std::basic_string<char>, _U2 = int, _T1 = const std::basic_string<char>, _T2 = int]â:
/usr/local/lib/gcc/i686-pc-linux-gnu/4.6.0/../../../../include/c++/4.6.0/type_traits:780:68: instantiated from âconst bool std::__is_convertible_helper<std::pair<std::basic_string<char>, int>&, std::pair<const std::basic_string<char>, int>, false>::__valueâ
/usr/local/lib/gcc/i686-pc-linux-gnu/4.6.0/../../../../include/c++/4.6.0/type_traits:787:12: instantiated from âstd::is_convertible<std::pair<std::basic_string<char>, int>&, std::pair<const std::basic_string<char>, int> >â
test.cpp:8:15: instantiated from here
/usr/local/lib/gcc/i686-pc-linux-gnu/4.6.0/../../../../include/c++/4.6.0/bits/stl_pair.h:107:43: internal compiler error: in build_data_member_initialization, at cp/semantics.c:5502
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
And here's the output of g++-4.6 -v:
Using built-in specs.
COLLECT_GCC=g++-4.6
COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/i686-pc-linux-gnu/4.6.0/lto-wrapper
Target: i686-pc-linux-gnu
Configured with: ../src/configure --program-suffix=-4.6 --enable-languages=c,c++
Thread model: posix
gcc version 4.6.0 20101209 (experimental) (GCC)
Thanks,
Nate.