[C++-sig] msvc_typeid problem on Intel/Linux compiler

Raoul Gough RaoulGough at yahoo.co.uk
Thu Oct 9 20:03:19 CEST 2003


In working on the new indexing suite, I encountered an error in an
instantiation of the type_id template. I think the relvant code is in
boost/python/type_id.hpp:

template <class T>
inline type_info type_id(BOOST_EXPLICIT_TEMPLATE_TYPE(T))
{
    return type_info(
#  if (!defined(BOOST_MSVC) || BOOST_MSVC > 1300)
&& (!defined(BOOST_INTEL_CXX_VERSION) || BOOST_INTEL_CXX_VERSION > 700)
        typeid(T)
#  else // strip the decoration which msvc and Intel mistakenly leave in
        python::detail::msvc_typeid((boost::type<T>*)0)
#  endif 
        );
}

BOOST_INTEL_CXX_VERSION is getting set to 700 for this compiler
(checked via a printf), which means that it currently selects the
workaround msvc_typeid, which leads to the error:

boost/python/detail/msvc_typeinfo.hpp(45): error: no instance of
function template "boost::python::detail::typeid_ref_1" matches the
argument list [...]

full text at http://home.clara.net/raoulgough/boost/typeid_problem.txt
- I believe it happens in an attempt to def() a static member function
with the signature:

[ in template<...> struct set_algorithms ]
  static void assign (std::set<int> &, int, void *dummy);

although it's hard to be completely sure from the type names in the
error message.  Anyway, I made a local change to test for intel
version >= 700 and the problem went away (i.e. selecting the
non-workaround, normal version for 700).

>From the CVS log, the current test was introduced for an Intel 7.0
Beta - maybe this changed prior to release? Strangely, icc -V reports
"Version 7.1 Build 20030307Z" despite the value of
BOOST_INTEL_CXX_VERSION. On the other hand, maybe this is a Linux
vs. Windows issue with the Intel compiler, and the test needs to check
the platform as well? Unfortunately, I can't confirm whether using >=
is OK on Windows, so I don't know if the fix is good or not.

-- 
Raoul Gough.
(setq dabbrev-case-fold-search nil)





More information about the Cplusplus-sig mailing list