[cfe-dev] __is_empty type trait patch

Sean Hunt rideau3 at gmail.com
Sun Aug 2 22:36:22 PDT 2009


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.

Sean Hunt



More information about the cfe-dev mailing list