[pkg-boost-devel] Bug#444359: also breaks other packages
Jiri Palecek
jpalecek at web.de
Fri Dec 14 10:29:47 UTC 2007
On Tuesday 11 December 2007 22:16:12 brian m. carlson wrote:
> On Mon, Dec 10, 2007 at 07:34:27PM -0700, Martin Michlmayr wrote:
> >> In file included from /usr/include/boost/python/class.hpp:29,
> >> from /usr/include/boost/python.hpp:18,
> >> from src/wrapper/common.hpp:1,
> >> from src/wrapper/basics.cpp:11:
> >> /usr/include/boost/python/detail/def_helper.hpp:192: error: declaration
> >> of 'typename
> >> boost::python::detail::keyword_extract<boost::tuples::tuple<const T1&,
> >> const T2&, const T3&, const T4&, boost::python::default_call_policies,
> >> boost::python::detail::keywords<0ul>, const char*, void
> >> (boost::python::detail::not_specified::*)(), boost::tuples::null_type,
> >> boost::tuples::null_type> >::result_type
> >> boost::python::detail::def_helper<T1, T2, T3, T4>::keywords() const'
> >> /usr/include/boost/python/args_fwd.hpp:35: error: changes meaning of
> >> 'keywords' from 'struct boost::python::detail::keywords<0ul>'
>
> Within a scope, each name can have only one meaning. The latter header
> declares a function named keywords, but before that point the name
> refers to struct boost::python::detail::keywords<0ul>, but after it
> refers to the function. Hence, before that point, invoking keywords()
> would create a new instance of an object, whereas afterward, it would
> invoke the function. Changing the meaning of the name like that is not
> allowed.
Yes, but this only applies to classes.
> This looks like a difficult problem, but the general solution is to
> either rename the function or move the declaration of the function to
> someplace where the other name isn't in scope. The latter doesn't seem
> possible here, so the former looks like the only option. I'd suggest
> talking to upstream and seeing what they're doing about this.
The problem is not difficult at all. The correct, and minimal fix would be to
refer to the keywords not-the-member-function as "struct keywords<0>" at the
beginning of the def_helper class definition.
> >> /usr/include/boost/type_traits/is_convertible.hpp:128: error: static
> >> data member
> >> 'boost::detail::is_convertible_basic_impl<<unnamed>::TagWrap*&,
> >> <unnamed>::TagWrap*>::_m_from' used, but not defined
>
> static data members must be explicitly defined, not just declared. In
> this case, _m_from is declared, but no explicit initialization has
> occurred. The solution is to actually define the static data member.
This seems like a bug in the compiler (or something), the static constants
like this are always initialized (at least should in boost). Check the
preprocessed source (gcc -E ...) for what's actually in the definition of
is_convertible_basic_impl.
Regards
Jiri Palecek
More information about the pkg-boost-devel
mailing list