[cfe-commits] [PATCH 02/15] Fix Cast

dag at cray.com dag at cray.com
Thu Jan 10 13:20:01 PST 2013


Dmitri Gribenko <gribozavr at gmail.com> writes:

> On Thu, Jan 10, 2013 at 9:12 PM, David Greene <dag at cray.com> wrote:
>> Avoid a cast-away-const error by properly using const_cast<>.
>
> -  return forallBases(BaseIsNot, (void*) Base->getCanonicalDecl());
> +  return forallBases(BaseIsNot,
> +                     const_cast<CXXRecordDecl *>(Base->getCanonicalDecl()));
>
> LGTM, but a better solution would be to add an overload to
> forallBases() with const void * to hide this cast there.

I would like to handle that question separately if possible.  The code
owners should probably make these kinds of decisions.

                              -David



More information about the cfe-commits mailing list