expr-comma-c99.c revision 8e8fb3be5bd78f0564444eca02b404566a5f3b5d
1// RUN: %clang_cc1 %s -fsyntax-only -verify -std=c99 2// expected-no-diagnostics 3// rdar://6095180 4 5struct s { char c[17]; }; 6extern struct s foo(void); 7 8struct s a, b, c; 9 10int A[sizeof((foo().c)) == 17 ? 1 : -1]; 11int B[sizeof((a.c)) == 17 ? 1 : -1]; 12 13 14// comma does array/function promotion in c99. 15int X[sizeof(0, (foo().c)) == sizeof(char*) ? 1 : -1]; 16int Y[sizeof(0, (a,b).c) == sizeof(char*) ? 1 : -1]; 17int Z[sizeof(0, (a=b).c) == sizeof(char*) ? 1 : -1]; 18 19