[boost.test] basic_cstring troubles with tru64cxx65

I think I have found the source of the internal compiler errors currently preventing boost.test to work with the toolset tru64cxx65. The following small sample fails to compile and gives me an internal compiler error when compiled with cxx. ---%<--- #include <boost/test/detail/basic_cstring/basic_cstring.hpp> using namespace boost::unit_test; // void foo(const_string const & s) // ok void foo(const_string s) // not ok { } int main() { foo(literal_string("foo")); return 0; } --->%--- Changing the declaration of foo() makes the compiler error go away. I'm currently thinking that the compiler perhaps has problems with the automatically generated copy constructors for the class basic_cstring. I tried writing an explicit copy constructor for basic_cstring but this doesn't seem to help. The compiler still crashes. Maybe someone else working with this platform has any ideas... Markus

Markus Schöpflin <markus.schoepflin@comsoft.de> writes:
I think I have found the source of the internal compiler errors currently preventing boost.test to work with the toolset tru64cxx65. The following small sample fails to compile and gives me an internal compiler error when compiled with cxx.
---%<--- #include <boost/test/detail/basic_cstring/basic_cstring.hpp>
using namespace boost::unit_test;
// void foo(const_string const & s) // ok void foo(const_string s) // not ok { }
int main() { foo(literal_string("foo")); return 0; } --->%---
Changing the declaration of foo() makes the compiler error go away. I'm currently thinking that the compiler perhaps has problems with the automatically generated copy constructors for the class basic_cstring.
I tried writing an explicit copy constructor for basic_cstring but this doesn't seem to help. The compiler still crashes.
Maybe someone else working with this platform has any ideas...
I suggest minimizing the example, including the basic_cstring part. We can then report the bug to EDG as well as Compaq. EDG may have a workaround. -- Dave Abrahams Boost Consulting http://www.boost-consulting.com

David Abrahams wrote:
I suggest minimizing the example, including the basic_cstring part. We can then report the bug to EDG as well as Compaq. EDG may have a workaround.
Here it is: ---%<--- template<typename CharT> class basic_cstring { typedef basic_cstring<CharT> self_type; public: typedef CharT value_type; typedef value_type* pointer; basic_cstring() {} basic_cstring( pointer s ) {} self_type& operator=( self_type const& s ) {} }; typedef basic_cstring<char const> const_string; typedef const_string const literal_string; void foo(const_string s) { } int main() { foo(literal_string("foo")); return 0; } --->%--- Markus

I got a response from HP with a minimal example for the problem and a workaround: ---%<--- struct A { A(char* s) { } }; #ifdef WORKAROUND typedef A B; #else typedef A const B; #endif void foo(B) {} main() { foo(B("foo")); } --->%--- I changed basic_cstring_fwd.hpp accordingly and it seems to compile now after some more minor changes. I'm currently running the regression tests; if they work out ok, I will post a patch for boost.test. Markus
participants (2)
-
David Abrahams
-
Markus Schöpflin