Boost Test (Boost 1.46.0) GCC 4.6.1 error: ambiguous overload for ‘operator[]’
Compiling my project unit tests and getting the following error (used to compile with older GCC (4.4?)):
/usr/include/boost/test/impl/debug.ipp: In function ‘std::string boost::debug::set_debugger(boost::unit_test::const_string, boost::debug::dbg_starter)’:
/usr/include/boost/test/impl/debug.ipp:737:46: error: ambiguous overload for ‘operator[]’ in ‘boost::debug::{anonymous}::s_info.boost::debug::{anonymous}::info_t::m_dbg_starter_reg[boost::debug::{anonymous}::s_info.boost::debug::{anonymous}::info_t::p_dbg]’
compilation terminated due to -Wfatal-errors.
Here is my machine info:
$ cat /etc/redhat-release
Fedora release 15 (Lovelock)
$ g++ --version
g++ (GCC) 4.6.1 20110908 (Red Hat 4.6.1-9)
$ yum list installed | fgrep boost
boost.x86_64 1.46.0-3.fc15 @updates
boost-build.noarch 1.46.0-3.fc15 @updates
boost-date-time.x86_64 1.46.0-3.fc15 @updates
boost-devel.x86_64 1.46.0-3.fc15 @updates
boost-doc.noarch 1.46.0-3.fc15 @updates
boost-filesystem.x86_64 1.46.0-3.fc15 @updates
boost-graph.x86_64 1.46.0-3.fc15 @updates
boost-graph-mpich2.x86_64 1.46.0-3.fc15 @updates
boost-iostreams.x86_64 1.46.0-3.fc15 @updates
boost-jam.x86_64 1.46.0-3.fc15 @updates
boost-mpich2.x86_64 1.46.0-3.fc15 @updates
boost-program-options.x86_64 1.46.0-3.fc15 @updates
boost-python.x86_64 1.46.0-3.fc15 @updates
boost-random.x86_64 1.46.0-3.fc15 @updates
boost-regex.x86_64 1.46.0-3.fc15 @updates
boost-serialization.x86_64 1.46.0-3.fc15 @updates
boost-signals.x86_64 1.46.0-3.fc15 @updates
boost-static.x86_64 1.46.0-3.fc15 @updates
boost-system.x86_64 1.46.0-3.fc15 @updates
boost-test.x86_64 1.46.0-3.fc15 @updates
boost-thread.x86_64 1.46.0-3.fc15 @updates
boost-wave.x86_64 1.46.0-3.fc15 @updates
BTW, I am using c++0x settings.
Here are all my g++ flags: -fmessage-length=0 -pedantic-errors -Wall -Wextra -Wconversion -Wcast-qual -Wcast-align -Wwrite-strings -Wlogical-op -Wfatal-errors -std=c++0x -g