[cfe-commits] [PATCH] Change counter-intuitive behavior of isDerivedFrom

Sean Silva silvas at purdue.edu
Fri Sep 7 12:09:34 PDT 2012


This patch is *pure evil* since it subtly changes the meaning of
existing code. It's better to just come up with completely new names
so that existing code, instead of silently misbehaving, will instead
fail to compile.

I think that isA is clearer for the non-strict base-of/derived-from
anyway: much less error prone. I think it would be good to have a
patch that just renames isBaseOf to isA.

In a later patch, you can then introduce a matcher for strict
base-of/derived-from notion.

--Sean Silva

On Fri, Sep 7, 2012 at 2:11 PM, Sebastian Redl
<reviews at llvm-reviews.chandlerc.com> wrote:
>
>   While I agree that this is more intuitive, we have precedent: std::is_base_of<X, X> is true, even though a class is no more a base of itself than derived from itself.
>
> http://llvm-reviews.chandlerc.com/D37
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits



More information about the cfe-commits mailing list