[Patch] Fix (similarly) libstdc++/9178 and 11305

Pétur Runólfsson peturr02@ru.is
Fri Jun 27 11:30:00 GMT 2003


> +	      int __ext_multiplier = _M_codecvt->encoding();
> +	      if (__ext_multiplier == -1 || __ext_multiplier == 0)
> +		__ext_multiplier = _M_codecvt->max_length();

I think this can be simplified to

    int __ext_multiplier = _M_codecvt->max_length();

since _M_codecvt->encoding() == _M_codecvt->max_length() if
_M_codecvt->encoding() > 0

> +  virtual int
> +  do_length(const StateT&, const extern_type* from,
> +	    const extern_type* end, size_t max) const
> +  {

According to the resolution to DR 75 (TC) the type of the first
parameter of length() and do_length() is StateT&, not const StateT&
(my fault, I wrote this testcase :-)

Thanks,
Petur



More information about the Libstdc++ mailing list