fork(1) download
  1. struct S1 {
  2. unsigned int a : 1;
  3. unsigned int b : 1;
  4. };
  5.  
  6. struct S2 {
  7. unsigned int a : 1, b : 1;
  8. };
  9.  
  10. struct S3 {
  11. unsigned int a;
  12. unsigned int b : 1;
  13. };
  14.  
  15. struct S4 {
  16. unsigned int a, b : 1;
  17. };
  18.  
  19. static_assert(sizeof(S1) == sizeof(S2), "Unexpected size");
  20. static_assert(sizeof(S1) != sizeof(S3), "Unexpected size");
  21. static_assert(sizeof(S2) != sizeof(S3), "Unexpected size");
  22. static_assert(sizeof(S3) == sizeof(S4), "Unexpected size");
  23.  
  24. int main()
  25. {
  26. return 0;
  27. }
Success #stdin #stdout 0s 3292KB
stdin
Standard input is empty
stdout
Standard output is empty