Boost logo

Boost :

From: David Abrahams (david.abrahams_at_[hidden])
Date: 2002-04-11 11:41:33


{Howard, I got Andreas' permission to post this bit about the Pro8
prerelease compiler}

Hi,

It looks to me as though CWPro8 is detecting bugs in our code which even
EDG doesn't find. I might be mistaken about some of these, but AFAICT
the compiler is right.

    1. I'd like to have a few other people tell me I'm not crazy
    2. I think is_class can be reimplemented to avoid all of these
problems using
       this technique:
http://groups.google.com/groups?hl=en&selm=7dc3b1ea.0203180455.2e0a6303%
40posting.google.com

    3. Unfortunately, we'd need to keep the existing implementation of
is_class for Pro7 support, since the sizeof() trick doesn't work there.

Thoughts?

-Dave

-------

metrowerks-C++-action
c:\build\status\bin\object_type_traits_test.test\cwpro8\debug\runtime-li
nk-dynamic\object_type_traits_test.obj
### mwcc Compiler:
# In: ..\boost\type_traits\conversion_traits.hpp
# From: ..\libs\type_traits\tests\object_type_traits_test.cpp
# --------------------------------------------------------------
# 190: ANT(bool, value = sizeof( _m_check(_m_from) ) ==
sizeof(type_traits::yes_type));
# Error:
^
# function call '[UDT].UDT({lval} volatile UDT)' does not match
# 'UDT::UDT()'
# 'UDT::UDT(const UDT &)'
# (point of instantiation: 'cpp_main(int, char **)')
# (instantiating: 'boost::is_class<volatile UDT>')
# (instantiating: 'boost::is_scalar<volatile UDT>')
# (instantiating: 'boost::is_enum<volatile UDT>')
# (instantiating:
'boost::detail::is_enum_helper<0>::type<volatile UDT &>')
# (instantiating: 'boost::is_convertible<volatile UDT &,
boost::detail::int_convertible>')
### mwcc Compiler:
# 190: ANT(bool, value = sizeof( _m_check(_m_from) ) ==
sizeof(type_traits::yes_type));
# Error:
^
# illegal access from 'std::basic_iostream<char,
std::char_traits<char>>' to protected/private member
'std::basic_iostream<char, std::char_traits<char>>::basic_iostream(const
std::basic_iostream<char, std::char_traits<char>> &)'
# (point of instantiation: 'cpp_main(int, char **)')
# (instantiating: 'boost::is_class<std::basic_iostream<char,
std::char_traits<char>>>')
# (instantiating: 'boost::is_scalar<std::basic_iostream<char,
std::char_traits<char>>>')
# (instantiating: 'boost::is_enum<std::basic_iostream<char,
std::char_traits<char>>>')
# (instantiating:
'boost::detail::is_enum_helper<0>::type<std::basic_iostream<char,
std::char_traits<char>> &>')
# (instantiating:
'boost::is_convertible<std::basic_iostream<char, std::char_traits<char>>
&, boost::detail::int_convertible>')
### mwcc Compiler:
# 190: ANT(bool, value = sizeof( _m_check(_m_from) ) ==
sizeof(type_traits::yes_type));
# Error:
^
# illegal access from 'boost::noncopyable' to protected/private member
'boost::noncopyable::noncopyable(const boost::noncopyable &)'
# (point of instantiation: 'cpp_main(int, char **)')
# (instantiating: 'boost::is_empty<boost::noncopyable>')
# (instantiating: 'boost::is_class<boost::noncopyable>')
# (instantiating: 'boost::is_scalar<boost::noncopyable>')
# (instantiating: 'boost::is_enum<boost::noncopyable>')
# (instantiating:
'boost::detail::is_enum_helper<0>::type<boost::noncopyable &>')
# (instantiating: 'boost::is_convertible<boost::noncopyable &,
boost::detail::int_convertible>')
### mwcc Compiler:
# 190: ANT(bool, value = sizeof( _m_check(_m_from) ) ==
sizeof(type_traits::yes_type));
# Error:
^
# illegal access from 'boost::noncopyable' to protected/private member
'boost::noncopyable::noncopyable(const boost::noncopyable &)'
# (point of instantiation: 'cpp_main(int, char **)')
# (instantiating: 'boost::is_empty<boost::noncopyable>')
# (instantiating: 'boost::is_convertible<boost::noncopyable &,
int>')
### mwcc Compiler:
# 190: ANT(bool, value = sizeof( _m_check(_m_from) ) ==
sizeof(type_traits::yes_type));
# Error:
^
# illegal access from 'non_empty' to protected/private member
'non_empty::non_empty(const non_empty &)'
# (point of instantiation: 'cpp_main(int, char **)')
# (instantiating: 'boost::is_empty<non_empty>')
# (instantiating: 'boost::is_class<non_empty>')
# (instantiating: 'boost::is_scalar<non_empty>')
# (instantiating: 'boost::is_enum<non_empty>')
# (instantiating:
'boost::detail::is_enum_helper<0>::type<non_empty &>')
# (instantiating: 'boost::is_convertible<non_empty &,
boost::detail::int_convertible>')
### mwcc Compiler:
# 190: ANT(bool, value = sizeof( _m_check(_m_from) ) ==
sizeof(type_traits::yes_type));
# Error:
^
# illegal access from 'non_empty' to protected/private member
'non_empty::non_empty(const non_empty &)'
# (point of instantiation: 'cpp_main(int, char **)')
# (instantiating: 'boost::is_empty<non_empty>')
# (instantiating: 'boost::is_convertible<non_empty &, int>')
### mwcc Compiler:
# 190: ANT(bool, value = sizeof( _m_check(_m_from) ) ==
sizeof(type_traits::yes_type));
# Error:
^
# illegal access from 'non_empty' to protected/private member
'non_empty::non_empty(const non_empty &)'
# (point of instantiation: 'cpp_main(int, char **)')
# (instantiating: 'boost::is_empty<const non_empty &>')
# (instantiating: 'boost::is_convertible<const non_empty &, int>')

+---------------------------------------------------------------+
                  David Abrahams
      C++ Booster (http://www.boost.org) O__ ==
      Pythonista (http://www.python.org) c/ /'_ ==
  resume: http://users.rcn.com/abrahams/resume.html (*) \(*) ==
          email: david.abrahams_at_[hidden]
+---------------------------------------------------------------+


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk