Package: g++-4.0 Version: 4.0.2-5 Severity: normal Hi, given this trivial C++ code:
#include <iostream> #include <boost/format.hpp> int main(void) { std::cout << boost::format("Hello %1%!\n%2%\n") % "world" % 343 << std::flush; return 0; } It fails to compile: $ g++ -frepo -c test.cc /usr/include/boost/mpl/aux_/integral_wrapper.hpp: In instantiation of ‘mpl_::integral_c<unsigned int, 0u>’: /usr/include/boost/type_traits/integral_constant.hpp:21: instantiated from ‘boost::integral_constant<unsigned int, 0u>’ /usr/include/boost/type_traits/alignment_of.hpp:81: instantiated from here /usr/include/boost/mpl/aux_/integral_wrapper.hpp:72: error: ‘(((unsigned int)mpl_::integral_c<unsigned int, 0u>::value) + 1u)’ is not a valid template argument for type ‘unsigned int’ because it is a non-constant expression /usr/include/boost/mpl/aux_/integral_wrapper.hpp: In instantiation of ‘mpl_::integral_c<unsigned int, 0u>’: /usr/include/boost/type_traits/integral_constant.hpp:21: instantiated from ‘boost::integral_constant<unsigned int, 0u>’ /usr/include/boost/type_traits/alignment_of.hpp:81: instantiated from here /usr/include/boost/mpl/aux_/integral_wrapper.hpp:73: error: ‘(((unsigned int)mpl_::integral_c<unsigned int, 0u>::value) - 1u)’ is not a valid template argument for type ‘unsigned int’ because it is a non-constant expression /usr/include/boost/mpl/aux_/integral_wrapper.hpp: In instantiation of ‘mpl_::int_<3>’: /usr/include/boost/mpl/if.hpp:131: instantiated from here /usr/include/boost/mpl/aux_/integral_wrapper.hpp:72: error: ‘(((int)mpl_::int_<3>::value) + 1)’ is not a valid template argument for type ‘int’ because it is a non-constant expression /usr/include/boost/mpl/aux_/integral_wrapper.hpp: In instantiation of ‘mpl_::int_<3>’: /usr/include/boost/mpl/if.hpp:131: instantiated from here /usr/include/boost/mpl/aux_/integral_wrapper.hpp:73: error: ‘(((int)mpl_::int_<3>::value) - 1)’ is not a valid template argument for type ‘int’ because it is a non-constant expression /usr/include/boost/mpl/aux_/integral_wrapper.hpp: In instantiation of ‘mpl_::int_<-0x00000000000000001>’: /usr/include/boost/mpl/if.hpp:131: instantiated from here /usr/include/boost/mpl/aux_/integral_wrapper.hpp:72: error: ‘(((int)mpl_::int_<-0x00000000000000001>::value) + 1)’ is not a valid template argument for type ‘int’ because it is a non-constant expression /usr/include/boost/mpl/aux_/integral_wrapper.hpp: In instantiation of ‘mpl_::int_<-0x00000000000000001>’: /usr/include/boost/mpl/if.hpp:131: instantiated from here /usr/include/boost/mpl/aux_/integral_wrapper.hpp:73: error: ‘(((int)mpl_::int_<-0x00000000000000001>::value) - 1)’ is not a valid template argument for type ‘int’ because it is a non-constant expression /usr/include/boost/mpl/aux_/integral_wrapper.hpp: In instantiation of ‘mpl_::int_<1>’: /usr/include/boost/mpl/not.hpp:47: instantiated from here /usr/include/boost/mpl/aux_/integral_wrapper.hpp:72: error: ‘(((int)mpl_::int_<1>::value) + 1)’ is not a valid template argument for type ‘int’ because it is a non-constant expression /usr/include/boost/mpl/aux_/integral_wrapper.hpp: In instantiation of ‘mpl_::int_<1>’: /usr/include/boost/mpl/not.hpp:47: instantiated from here /usr/include/boost/mpl/aux_/integral_wrapper.hpp:73: error: ‘(((int)mpl_::int_<1>::value) - 1)’ is not a valid template argument for type ‘int’ because it is a non-constant expression /usr/include/boost/mpl/if.hpp: In instantiation of ‘boost::mpl::if_<boost::integral_constant<bool, false>, boost::optional_detail::types_when_is_ref<std::locale>, boost::optional_detail::types_when_isnt_ref<std::locale> >’: /usr/include/boost/optional/optional.hpp:152: instantiated from ‘boost::optional_detail::optional_base<std::locale>’ /usr/include/boost/optional/optional.hpp:407: instantiated from ‘boost::optional<std::locale>’ /usr/include/boost/format/internals.hpp:56: instantiated from here /usr/include/boost/mpl/if.hpp:67: error: ‘mpl_::bool_<false>::value’ is not a valid template argument for type ‘bool’ because it is a non-constant expression /usr/include/boost/mpl/if.hpp: In instantiation of ‘boost::mpl::if_<boost::integral_constant<bool, false>, boost::optional_detail::types_when_is_ref<std::locale>, boost::optional_detail::types_when_isnt_ref<std::locale> >’: /usr/include/boost/optional/optional.hpp:152: instantiated from ‘boost::optional_detail::optional_base<std::locale>’ /usr/include/boost/optional/optional.hpp:407: instantiated from ‘boost::optional<std::locale>’ /usr/include/boost/format/internals.hpp:56: instantiated from here /usr/include/boost/mpl/if.hpp:70: error: ‘mpl_::bool_<false>::value’ is not a valid template argument for type ‘bool’ because it is a non-constant expression /usr/include/boost/mpl/aux_/integral_wrapper.hpp: In instantiation of ‘mpl_::integral_c<unsigned int, 4u>’: /usr/include/boost/type_traits/integral_constant.hpp:21: instantiated from ‘boost::integral_constant<unsigned int, 4u>’ /usr/include/boost/type_traits/alignment_of.hpp:61: instantiated from ‘boost::alignment_of<std::locale>’ /usr/include/boost/optional/optional.hpp:97: instantiated from ‘boost::optional_detail::aligned_storage<std::locale>::dummy_u’ /usr/include/boost/optional/optional.hpp:98: instantiated from ‘boost::optional_detail::aligned_storage<std::locale>’ /usr/include/boost/optional/optional.hpp:400: instantiated from ‘boost::optional_detail::optional_base<std::locale>’ /usr/include/boost/optional/optional.hpp:407: instantiated from ‘boost::optional<std::locale>’ /usr/include/boost/format/internals.hpp:56: instantiated from here /usr/include/boost/mpl/aux_/integral_wrapper.hpp:72: error: ‘(((unsigned int)mpl_::integral_c<unsigned int, 4u>::value) + 1u)’ is not a valid template argument for type ‘unsigned int’ because it is a non-constant expression /usr/include/boost/mpl/aux_/integral_wrapper.hpp: In instantiation of ‘mpl_::integral_c<unsigned int, 4u>’: /usr/include/boost/type_traits/integral_constant.hpp:21: instantiated from ‘boost::integral_constant<unsigned int, 4u>’ /usr/include/boost/type_traits/alignment_of.hpp:61: instantiated from ‘boost::alignment_of<std::locale>’ /usr/include/boost/optional/optional.hpp:97: instantiated from ‘boost::optional_detail::aligned_storage<std::locale>::dummy_u’ /usr/include/boost/optional/optional.hpp:98: instantiated from ‘boost::optional_detail::aligned_storage<std::locale>’ /usr/include/boost/optional/optional.hpp:400: instantiated from ‘boost::optional_detail::optional_base<std::locale>’ /usr/include/boost/optional/optional.hpp:407: instantiated from ‘boost::optional<std::locale>’ /usr/include/boost/format/internals.hpp:56: instantiated from here /usr/include/boost/mpl/aux_/integral_wrapper.hpp:73: error: ‘(((unsigned int)mpl_::integral_c<unsigned int, 4u>::value) - 1u)’ is not a valid template argument for type ‘unsigned int’ because it is a non-constant expression /usr/include/boost/optional/optional.hpp: In instantiation of ‘boost::optional_detail::aligned_storage<std::locale>::dummy_u’: /usr/include/boost/optional/optional.hpp:98: instantiated from ‘boost::optional_detail::aligned_storage<std::locale>’ /usr/include/boost/optional/optional.hpp:400: instantiated from ‘boost::optional_detail::optional_base<std::locale>’ /usr/include/boost/optional/optional.hpp:407: instantiated from ‘boost::optional<std::locale>’ /usr/include/boost/format/internals.hpp:56: instantiated from here /usr/include/boost/optional/optional.hpp:97: error: ‘mpl_::integral_c<unsigned int, 4u>::value’ is not a valid template argument for type ‘unsigned int’ because it is a non-constant expression /usr/include/boost/format/internals.hpp: In member function ‘void boost::io::detail::stream_format_state<Ch, Tr>::apply_on(std::basic_ios<_CharT, _Traits>&, boost::io::detail::locale_t*) const’: /usr/include/boost/format/internals.hpp:119: error: ‘const class boost::optional<std::locale>’ has no member named ‘get’ /usr/include/boost/format/format_implementation.hpp: In member function ‘boost::io::detail::locale_t boost::basic_format<Ch, Tr, Alloc>::getloc() const’: /usr/include/boost/format/format_implementation.hpp:56: error: ‘const class boost::optional<std::locale>’ has no member named ‘get’ /usr/include/boost/optional/optional.hpp: In member function ‘void boost::optional_detail::optional_base<T>::destroy_impl(mpl_::false_) [with T = std::locale]’: /usr/include/boost/optional/optional.hpp:362: instantiated from ‘void boost::optional_detail::optional_base<T>::destroy() [with T = std::locale]’ /usr/include/boost/optional/optional.hpp:208: instantiated from ‘boost::optional_detail::optional_base<T>::~optional_base() [with T = std::locale]’ /usr/include/boost/optional/optional.hpp:471: instantiated from ‘boost::optional<T>::~optional() [with T = std::locale]’ /usr/include/boost/format/format_fwd.hpp:30: instantiated from here /usr/include/boost/optional/optional.hpp:388: error: ‘get_ptr_impl’ was not declared in this scope Regards, Roger -- System Information: Debian Release: testing/unstable APT prefers unstable APT policy: (990, 'unstable') Architecture: powerpc (ppc) Shell: /bin/sh linked to /bin/bash Kernel: Linux 2.6.14.5 Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8) Versions of packages g++-4.0 depends on: ii gcc-4.0 4.0.2-5 The GNU C compiler ii gcc-4.0-base 4.0.2-5 The GNU Compiler Collection (base ii libc6 2.3.5-9 GNU C Library: Shared libraries an ii libstdc++6-4.0-dev 4.0.2-5 The GNU Standard C++ Library v3 (d g++-4.0 recommends no packages. -- no debconf information