stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Sebor <>
Subject Re: 21.strings.cpp bug
Date Wed, 05 Jul 2006 00:00:30 GMT
Farid Zaripov wrote:
> I found the following code in 21.strings.cpp line 1504:
>                 if (StringIds::None == iter_types [l]) {
>                     // skip a non-sensical template specialization
>  >                   break;
>                 }
> Here the "break" clause should be replaced with "continue".
> Suppose that in the StringTest array some template method is situated 
> before any non-template method(s).
> The current version will skip these non-template methods exercising 
> because of this "break".

I think you are correct. IIRC, this was supposed to be a simple
optimization but it looks like it was ill-conceived. But now that
I'm looking at the code more closely I'm beginning to wonder if
it isn't backwards. I.e., it seems to me that the loop that
iterates over the different iterator categories and types should
be nested in the one that loops over the tests, and should only
be entered when 1 < _rw_argno (test.which, StringIds::arg_range))
is true. What do you think about the attached patch?


View raw message