[C++] simplify check_for_casting_away_constness

Manuel López-Ibáñez lopezibanez@gmail.com
Wed Nov 14 12:56:00 GMT 2007


On 14/11/2007, Mark Mitchell <mark@codesourcery.com> wrote:
> Manuel López-Ibáñez wrote:
>
> > 2007-11-14  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
> >
> >   * typeck.c (check_for_casting_away_constness): Use 1 single
> > argument, the type of cast, to decide what diagnostics generate.
> >   (build_static_cast_1): Remove unused code. Call
> > check_for_casting_away_constness with cast_type 2.
> >   (build_reinterpret_cast_1): Call check_for_casting_away_constness
> > with cast_type 3.
> >   (build_const_cast_1): Call check_for_casting_away_constness with cast_type 1.
>
> As far as I can tell, this isn't a bug fix, so it needs to wait for
> Stage 1.  I've not thought about whether this seems like an improvement
> or not, but we certainly want an enum, rather than magic numbers, for
> the switch values if we do this.
>

Oh, that is true. I was trying to fix something and I needed this as a
previous step. But yes, it can wait until stage 1. I will resend then
using an enum.

Thanks,

Manuel.



More information about the Gcc-patches mailing list