c++ - [bug] Crash when generating debug info.
- Daniel James (11/11) May 31 2005 Hi Walter,
- Walter (5/8) May 31 2005 Thanks, Daniel. I'm especially interested if Boost::type_traits is worki...
- Daniel James (52/55) Jun 05 2005 I expect the preprocessor is now good enough for everything in boost.
- Daniel James (6/11) Jun 05 2005 This is caused by a new test that has been added, so it's not a
- Daniel James (27/29) Jun 05 2005 Here's a test case which demonstrates the problem:
- Daniel James (15/33) Jun 05 2005 There's something odd going on with const arrays in general. This code:
- Walter (1/1) Jun 05 2005 Thanks, you've given me a lot to chew on, here!
Hi Walter, Thanks for the fix, it's looks good. I've got a couple more reports, although I think I can easily work around them for now. First up, when compiling with the -g flag, this code causes dmc to crash. struct a { a(a const&) {} template<typename T> a(T t) {} }; struct b { a x; };
May 31 2005
"Daniel James" <daniel calamity.org.uk> wrote in message news:d7h4a8$12gr$1 digitaldaemon.com...Hi Walter, Thanks for the fix, it's looks good. I've got a couple more reports, although I think I can easily work around them for now.Thanks, Daniel. I'm especially interested if Boost::type_traits is working 100% now, and also if the preprocessor conformance improvements are putting us over the top.
May 31 2005
Walter wrote:Thanks, Daniel. I'm especially interested if Boost::type_traits is working 100% now, and also if the preprocessor conformance improvements are putting us over the top.I expect the preprocessor is now good enough for everything in boost. I've actually been concentrating on getting Boost.Test to work, so that more libraries can be tested. It seems that in some cases getting the tests to work is harder than getting the library to work. 100% type traits conformance would require a lot of work, including implementing some extensions from TR1, but I think that currently they're good enough for most of the boost libraries which use them. I've just rerun all the type traits tests, and I've written a summary of what I found below, I'll look into some of the problems in more detail. boost::decay and boost::extent don't seem to work. They were both added fairly recently and I haven't looked at them yet. is_abstract doesn't work. I think it requires SFINAE which isn't implemented in Digital Mars. It also requires a defect report to be implemented, details in the comments at: http://www.boost.org/boost/type_traits/is_abstract.hpp Something in the tests for is_base_and_derived is causing: Internal error: newman 669 Which is new - I'll look into this more. The full version of is_base_and_derived doesn't work, you can read about how it's meant to work in the comments at: http://www.boost.org/boost/type_traits/is_base_and_derived.hpp But there's an alternative version which just uses is_convertible. This doesn't work for private bases or with multiple inheritance from a single base, but it does work for all other cases. is_function isn't working - I can't remember if it was before. I'll have a look into this as well. is_enum is failing on 'tricky_is_enum_test'. I didn't bother with that test last time as it's quite contrived, but I'll see if I can tell what's going on. The tests for add_const, add_volatile and add_cv are giving very strange errors, such as: add_const_test.cpp:26: The expression: "expression" did not have the expected type: evaluating: boost::is_same<bool const[2][3], ::boost::add_const<bool [2][3]>::type> found: boost::boost::is_same<bool[2][3],bool,bool[2][3]> add_const_test.cpp:26: The expression: "expression" did not have the expected type: evaluating: boost::is_same<char const[2][3], ::boost::add_const<char [2][3]>::type> found: boost::boost::is_same<bool[2][3],char ,char [2][3]> Which suggests that somethings going wrong with the tests rather than the library. There also seems to be a problem with typeid (which is used to write out the result). What's really odd is that the found type has three template parameters when it should have two. is_const<const void> and is_volatile<volatile void> don't seem to work either. And of course, the tests which require an extension are failing. That seems like quite a long list, but it isn't that bad. There are a lot of type_traits, and few compilers fully support them all. Daniel
Jun 05 2005
Something in the tests for is_base_and_derived is causing: Internal error: newman 669 Which is new - I'll look into this more.This is caused by a new test that has been added, so it's not a regression. This code triggers the error: struct foo{ int x; }; template<int foo::*PtrToMember> struct class_member{}; typedef class_member<&foo::x> mem_type; Daniel
Jun 05 2005
Daniel James wrote:is_function isn't working - I can't remember if it was before. I'll have a look into this as well.Here's a test case which demonstrates the problem: template <class R> struct is_function_ptr_helper; template <class R > struct is_function_ptr_helper<R (*)()> { }; template <class R > struct is_function_ptr_helper<R (*)( ...)> { }; template <class R , class T0> struct is_function_ptr_helper<R (*)( T0)> { }; template <class R , class T0> struct is_function_ptr_helper<R (*)( T0 ...)> { }; typedef is_function_ptr_helper<void(*)()> test1; typedef is_function_ptr_helper<void(*)(int)> test2; Causes: dmc simple_test.cpp typedef is_function_ptr_helper<void(*)()> helper; ^ simple_test.cpp(12) : Error: ambiguous match of class template partial specialization 'is_function_ptr_helper' typedef is_function_ptr_helper<void(*)(int)> helper; ^ simple_test.cpp(13) : Error: ambiguous match of class template partial specialization 'is_function_ptr_helper' I can post a patch to the boost list to disable the ellipsis, which will work around this one for now. Daniel
Jun 05 2005
Daniel James wrote:The tests for add_const, add_volatile and add_cv are giving very strange errors, such as: add_const_test.cpp:26: The expression: "expression" did not have the expected type: evaluating: boost::is_same<bool const[2][3], ::boost::add_const<bool [2][3]>::type> found: boost::boost::is_same<bool[2][3],bool,bool[2][3]> add_const_test.cpp:26: The expression: "expression" did not have the expected type: evaluating: boost::is_same<char const[2][3], ::boost::add_const<char [2][3]>::type> found: boost::boost::is_same<bool[2][3],char ,char [2][3]> Which suggests that somethings going wrong with the tests rather than the library. There also seems to be a problem with typeid (which is used to write out the result). What's really odd is that the found type has three template parameters when it should have two.There's something odd going on with const arrays in general. This code: template <class T> class wrap {}; wrap<long const [3]> x; int y = x; causes this error: int y = x; ^ simple_test.cpp(3) : Error: need explicit cast to convert from: wrap<bool[3],long > to : int When you'd expect: from: wrap<long const [3]> to : int Daniel
Jun 05 2005
Thanks, you've given me a lot to chew on, here!
Jun 05 2005