Boost logo

Boost :

From: Gubenko, Boris (boris.gubenko_at_[hidden])
Date: 2008-08-04 13:16:18


Gennadiy Rozental wrote:
> Go ahead and fix it. You can post patch here.

Attached is rather obvious patch, verified with GCC 4.3.0 and 3.4.6.

Ok to commit?

We can make 'typename utf::basic_cstring<CharT>::size_type' a macro, to reduce clutter, but since it was not a macro (without a 'typename', of course) in the original code, I did not do it.

Thanks,
  Boris

Index: test/basic_cstring_test.cpp
===================================================================
--- test/basic_cstring_test.cpp (revision 47969)
+++ test/basic_cstring_test.cpp (working copy)
@@ -406,26 +406,26 @@
 {
     utf::basic_cstring<CharT> bcs1( TEST_STRING );

- utf::basic_cstring<CharT>::size_type not_found = (utf::basic_cstring<CharT>::size_type)utf::basic_cstring<CharT>::npos;
+ typename utf::basic_cstring<CharT>::size_type not_found = (typename utf::basic_cstring<CharT>::size_type)utf::basic_cstring<Cha
rT>::npos;

     BOOST_CHECK_EQUAL( bcs1.find( utf::basic_cstring<CharT>() ), not_found );
- BOOST_CHECK_EQUAL( bcs1.find( LITERAL( "test" ) ), (utf::basic_cstring<CharT>::size_type)0 );
- BOOST_CHECK_EQUAL( bcs1.find( TEST_STRING ), (utf::basic_cstring<CharT>::size_type)0 );
+ BOOST_CHECK_EQUAL( bcs1.find( LITERAL( "test" ) ), (typename utf::basic_cstring<CharT>::size_type)0 );
+ BOOST_CHECK_EQUAL( bcs1.find( TEST_STRING ), (typename utf::basic_cstring<CharT>::size_type)0 );
     BOOST_CHECK_EQUAL( bcs1.find( LITERAL( "test_string " ) ), not_found );
     BOOST_CHECK_EQUAL( bcs1.find( LITERAL( " test_string" ) ), not_found );
- BOOST_CHECK_EQUAL( bcs1.find( LITERAL( "est" ) ), (utf::basic_cstring<CharT>::size_type)1 );
- BOOST_CHECK_EQUAL( bcs1.find( LITERAL( "t_st" ) ), (utf::basic_cstring<CharT>::size_type)3 );
- BOOST_CHECK_EQUAL( bcs1.find( LITERAL( "ing" ) ), (utf::basic_cstring<CharT>::size_type)8 );
+ BOOST_CHECK_EQUAL( bcs1.find( LITERAL( "est" ) ), (typename utf::basic_cstring<CharT>::size_type)1 );
+ BOOST_CHECK_EQUAL( bcs1.find( LITERAL( "t_st" ) ), (typename utf::basic_cstring<CharT>::size_type)3 );
+ BOOST_CHECK_EQUAL( bcs1.find( LITERAL( "ing" ) ), (typename utf::basic_cstring<CharT>::size_type)8 );
     BOOST_CHECK_EQUAL( bcs1.find( LITERAL( "tst" ) ), not_found );

     BOOST_CHECK_EQUAL( bcs1.rfind( utf::basic_cstring<CharT>() ), not_found );
- BOOST_CHECK_EQUAL( bcs1.rfind( LITERAL( "test" ) ), (utf::basic_cstring<CharT>::size_type)0 );
- BOOST_CHECK_EQUAL( bcs1.rfind( TEST_STRING ), (utf::basic_cstring<CharT>::size_type)0 );
+ BOOST_CHECK_EQUAL( bcs1.rfind( LITERAL( "test" ) ), (typename utf::basic_cstring<CharT>::size_type)0 );
+ BOOST_CHECK_EQUAL( bcs1.rfind( TEST_STRING ), (typename utf::basic_cstring<CharT>::size_type)0 );
     BOOST_CHECK_EQUAL( bcs1.rfind( LITERAL( "test_string " ) ), not_found );
     BOOST_CHECK_EQUAL( bcs1.rfind( LITERAL( " test_string" ) ), not_found );
- BOOST_CHECK_EQUAL( bcs1.rfind( LITERAL( "est" ) ), (utf::basic_cstring<CharT>::size_type)1 );
- BOOST_CHECK_EQUAL( bcs1.rfind( LITERAL( "t_st" ) ), (utf::basic_cstring<CharT>::size_type)3 );
- BOOST_CHECK_EQUAL( bcs1.rfind( LITERAL( "ing" ) ), (utf::basic_cstring<CharT>::size_type)8 );
+ BOOST_CHECK_EQUAL( bcs1.rfind( LITERAL( "est" ) ), (typename utf::basic_cstring<CharT>::size_type)1 );
+ BOOST_CHECK_EQUAL( bcs1.rfind( LITERAL( "t_st" ) ), (typename utf::basic_cstring<CharT>::size_type)3 );
+ BOOST_CHECK_EQUAL( bcs1.rfind( LITERAL( "ing" ) ), (typename utf::basic_cstring<CharT>::size_type)8 );
     BOOST_CHECK_EQUAL( bcs1.rfind( LITERAL( "tst" ) ), not_found );
 }

> -----Original Message-----
> From: boost-bounces_at_[hidden]
> [mailto:boost-bounces_at_[hidden]] On Behalf Of Gennadiy Rozental
> Sent: Saturday, August 02, 2008 12:15 PM
> To: boost_at_[hidden]
> Subject: Re: [boost] [test] failure of basic_cstring_test
> with GNU libstdc++
>
> Gubenko, Boris <boris.gubenko <at> hp.com> writes:
>
> >
> > Stefan Seefeld wrote:
> > > Aren't you missing a 'typename' in the above ?
> >
> > Right. Thanks! In fact, it does not compile with EDG-based
> compilers
> > in strict
> ansi mode also.
> >
> > Gennadiy, will you fix the test yourself or do you want a patch?
>
> Go ahead and fix it. You can post patch here.
>
> Gennadiy
>
> _______________________________________________
> Unsubscribe & other changes:
> http://lists.boost.org/mailman/listinfo.cgi/boost
>


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