[cfe-dev] __is_empty type trait patch

Eli Friedman eli.friedman at gmail.com
Mon Aug 3 00:35:05 PDT 2009


On Sun, Aug 2, 2009 at 10:36 PM, Sean Hunt<rideau3 at gmail.com> wrote:
> Eli Friedman wrote:
>> Yeah, having a bunch of tests is good.  It's generally not a good idea
>> to put in commented-out tests, though; if it gives an error, use an
>> expected-error marking, and put a comment that the error isn't
>> correct.  (If it crashes, of course, it's better to leave it commented
>> out.)
>
> Ah. Virtual bases are unsupported, so I figured commenting out the tests
> until they are was the best choice of action.
>
>> This looks suspicious; is it really supposed to default to true?  (At
>> first glance, it looks like it will misclassify a struct with only
>> bitfields.)
>>
>> Otherwise, looks fine.
>>
>> -Eli
>
> Yes, because if the width expression is dependent, it shouldn't cause
> the class to be marked as non-empty at that point in the code (every
> other exit point should be a false return, I think). Come to think of
> it, I think I forgot to add a check when instantiating a template.
>
> I'll go off to check that.

Okay; that makes sense; the reason it looks suspicious is that there
isn't any path where it subsequently gets set to false.

-Eli




More information about the cfe-dev mailing list