[cfe-commits] [Patch review request] Binary type traits

Howard Hinnant hhinnant at apple.com
Fri Jan 28 12:09:05 PST 2011


On Jan 27, 2011, at 3:31 PM, Douglas Gregor wrote:

> 
> On Jan 27, 2011, at 10:13 AM, Howard Hinnant wrote:
> 
>> On Sep 17, 2010, at 7:00 PM, Steven Watanabe wrote:
>> 
>>> AMDG
>>> 
>>> The attached patch implements __is_base_of and __is_convertible_to.
>>> These are the last intrinsics required to compile the <type_traits> header
>>> that ships with MSVC 10.0.
>>> 
>>> In Christ,
>>> Steven Watanabe
>>> 
>>> <binary_type_traits.patch>_______________________________________________
>>> cfe-commits mailing list
>>> cfe-commits at cs.uiuc.edu
>>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>> 
>> Ping.  What is the status of this patch?  libc++ is in desperate need of __is_convertible_to.
> 
> I've updated the patch and committed it as r124425. Thanks, Steven!

I just hooked up is_base_of and believe I'm seeing some minor corner-case failures:

struct B {};
struct B1 : B {};
struct B2 : B {};
struct D : private B1, private B2 {};

__is_base_of(B&, D&) answers true, but should be false.  Rationale: B& and D& are not class types.
__is_base_of(B[3], D[3]) answers true, but should be false.  Rationale: B[3] and D[3] are not class types.
__is_base_of(int, int) answers true, but should be false.  Rationale: int is not a class type.

Reference:

[meta.rel] Table 50:

> Base is a base class of Derived (10) without regard to cv-qualifiers or Base and Derived are not unions and name the same class type without regard to cv-qualifiers

-Howard






More information about the cfe-commits mailing list