This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [C++] simplify check_for_casting_away_constness
- From: Mark Mitchell <mark at codesourcery dot com>
- To: Manuel López-Ibáñez <lopezibanez at gmail dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 13 Nov 2007 20:13:38 -0800
- Subject: Re: [C++] simplify check_for_casting_away_constness
- References: <6c33472e0711131544r288374f5v15807b1fbbcb0c28@mail.gmail.com>
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.
--
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713