[cfe-dev] Tests for __is_standard_layout

Dmitri Gribenko gribozavr at gmail.com
Fri Mar 30 11:33:13 PDT 2012


On Fri, Mar 30, 2012 at 9:28 PM, Matthieu Monrocq
<matthieu.monrocq at gmail.com> wrote:
> Le 29 mars 2012 23:49, Dmitri Gribenko <gribozavr at gmail.com> a écrit :
>> Hi,
>>
>> >From test/SemaCXX/type-traits.cpp:
>>
>> struct CppStructNonStandardBySameBase : CEmptyStruct {
>>  CEmptyStruct member;
>> };
>> struct CppStructNonStandardBy2ndVirtBase : CEmptyStruct {
>>  CEmptyStruct member;
>> };
>>
>> ...
>>
>>  int t16[F(__is_standard_layout(CppStructNonStandardBySameBase))];
>>  int t17[F(__is_standard_layout(CppStructNonStandardBy2ndVirtBase))];
>>
>> Both tests are identical, so either original author wanted to test
>> something else in the second test or that test can be safely removed.
>>
>> After looking at the definition of a standard-layout class, I don't
>> see anything not covered by other tests.
>
> Given the name of the second, it looks to me like it was supposed to have a
> virtual base class.

Hi Matthieu,

Virtual base class case is covered by other test in the same file.

Dmitri

-- 
main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
(j){printf("%d\n",i);}}} /*Dmitri Gribenko <gribozavr at gmail.com>*/




More information about the cfe-dev mailing list