[algorithm/string] predicate failure for CW8

It took some digging but I figured out what the problem with the failure on this test is for CW8. Basically CW8 is doing a copy construction on the use of static_cast for a reference when the type of the reference is itself a template typename. In all other cases it does the cast correctly. The work-around is to do the cast on the pointer type and dereference instead of the cast on the reference directly: =================================================================== RCS file: /cvsroot/boost/boost/boost/algorithm/string/classification.hpp,v retrieving revision 1.4 diff -u -r1.4 classification.hpp --- classification.hpp 15 Jul 2004 21:48:25 -0000 1.4 +++ classification.hpp 29 Jul 2004 21:32:49 -0000 @@ -236,8 +236,8 @@ const predicate_facade<Pred2T>& Pred2 ) { return detail::pred_andF<Pred1T,Pred2T>( - static_cast<const Pred1T&>(Pred1), - static_cast<const Pred2T&>(Pred2) ); + *static_cast<const Pred1T*>(&Pred1), + *static_cast<const Pred2T*>(&Pred2) ); } //! predicate 'or' composition predicate @@ -257,8 +257,8 @@ const predicate_facade<Pred2T>& Pred2 ) { return detail::pred_orF<Pred1T,Pred2T>( - static_cast<const Pred1T&>(Pred1), - static_cast<const Pred2T&>(Pred2)); + *static_cast<const Pred1T*>(&Pred1), + *static_cast<const Pred2T*>(&Pred2)); } //! predicate negation operator @@ -273,7 +273,7 @@ inline detail::pred_notF<PredT> operator!( const predicate_facade<PredT>& Pred ) { - return detail::pred_notF<PredT>(static_cast<const PredT&>(Pred)); + return detail::pred_notF<PredT>(*static_cast<const PredT*>(&Pred)); } } // namespace algorithm =================================================================== Those changes make it work on CW8, and it still works on VC7.1 and MinGW. OK to commit?? -- I'll assume the answer is *yes* after a few hours ;-) -- -- Grafik - Don't Assume Anything -- Redshift Software, Inc. - http://redshift-software.com -- rrivera/acm.org - grafik/redshift-software.com - 102708583/icq

Rene Rivera wrote:
OK to commit?? -- I'll assume the answer is *yes* after a few hours ;-)
Yes assumed. Changes committed, with a brief explanation. -- -- Grafik - Don't Assume Anything -- Redshift Software, Inc. - http://redshift-software.com -- rrivera/acm.org - grafik/redshift-software.com - 102708583/icq

Rene Rivera wrote:
Yup. See also: http://article.gmane.org/gmane.comp.lib.boost.devel/95575 http://article.gmane.org/gmane.comp.lib.boost.devel/95579 -- Giovanni Bajo

Giovanni Bajo wrote:
Thanks for the references... It still doesn't make the error easier to locate :-( I just spent many hours finding another one of these that was preventing the serialization lib from working. -- More on that in another post. -- -- Grafik - Don't Assume Anything -- Redshift Software, Inc. - http://redshift-software.com -- rrivera/acm.org - grafik/redshift-software.com - 102708583/icq
participants (3)
-
Giovanni Bajo
-
Pavol Droba
-
Rene Rivera