void dr204(void) {
__typeof__(sizeof(0)) s;
__typeof__((int *)0 - (int *)0) p;
signed long sl;
#if __LLONG_WIDTH__ > __LONG_WIDTH__
(void)_Generic(s + sl, unsigned long long : 1, unsigned long : 1, unsigned int : 1);
(void)_Generic(p + sl, signed long long : 1, signed long : 1, signed int : 1);
#elif __LLONG_WIDTH__ == __LONG_WIDTH__
(void)_Generic(s + sl, unsigned long : 1, unsigned int : 1);
(void)_Generic(p + sl, signed long : 1, signed int : 1);
#else
#error "Something has gone off the rails"
#endif
}
void dr207(void) {
_Imaginary float f;
}
void dr216(void) {
#define A(x) _Static_assert((char)x >= 0, "no")
A('A'); A('B'); A('C'); A('D'); A('E'); A('F'); A('G'); A('H'); A('I');
A('J'); A('K'); A('L'); A('M'); A('N'); A('O'); A('P'); A('Q'); A('R');
A('S'); A('T'); A('U'); A('V'); A('W'); A('X'); A('Y'); A('Z');
A('a'); A('b'); A('c'); A('d'); A('e'); A('f'); A('g'); A('h'); A('i');
A('j'); A('k'); A('l'); A('m'); A('n'); A('o'); A('p'); A('q'); A('r');
A('s'); A('t'); A('u'); A('v'); A('w'); A('x'); A('y'); A('z');
A('0'); A('1'); A('2'); A('3'); A('4');
A('5'); A('6'); A('7'); A('8'); A('9');
A('!'); A('"'); A('#'); A('%'); A('&'); A('\''); A('('); A(')'); A('*');
A('+'); A(','); A('-'); A('.'); A('/'); A(':'); A(';'); A('<'); A('=');
A('>'); A('?'); A('['); A('\\'); A(']'); A('^'); A('_'); A('{'); A('|');
A('}'); A('~');
#undef A
}
void dr230(void) {
enum E {
Value = __INT_MAX__
} e;
(void)_Generic(e, int : 1, unsigned int : 1);
(void)_Generic((enum E)Value, int : 1, unsigned int : 1);
(void)_Generic(Value, int : 1);
}
# nope
# 'a
/* expected-error@-1 {{invalid preprocessing directive}} \
expected-warning@-1 {{missing terminating ' character}}
void dr237_f(int array[static 10]);
void dr237_1(void) {
int array[4];
dr237_f(array);
}
void dr237_f(int array[]);
void dr237_2(void) {
int array[4];
dr237_f(array);
}
void dr246(void) {
int i[i];
}
void dr250(void) {
#define dr250_nothing(x)
dr250_nothing(
#nondirective
)
#undef dr250_nothing
}
union dr251_fred { int a; };
void dr251(void) {
struct dr251_fred *ptr;
}
#if __STDC_VERSION__ < 202000L
void dr252_no_proto();
void dr252_proto(void);
void dr252(void) {
dr252_proto(dr252_no_proto());
dr252_no_proto(dr252_proto());
}
#endif
void dr258(void) {
#define repeat(x) x && x
#if repeat(defined fred)
#endif
#define forget(x) 0
#if forget(defined fred)
#endif
#undef repeat
#undef forget
}
void dr261(void) {
enum e1 {
ex1 = __INT_MAX__ + 1
};
enum e2 {
ex2 = __INT_MAX__ + (0, 1)
};
char *p1 = (1 - 1);
char *p2 = (42, 1 - 1);
p1 = (42, 1 - 1);
short s1 = 42 + (0, 1);
s1 = (42, 69);
p2 = 0;
p2 = 1 - 1;
}
void dr262(void) {
_Static_assert(sizeof(short) == 2, "short is not two chars?");
struct S {
short field : __CHAR_BIT__ * 2;
short other_field : __CHAR_BIT__ * 2 + 1;
};
}
_Static_assert(__builtin_popcount(0) < 1, "zero is not all zero bits");
#if __UINT_MAX__ == 0xFFFFFFFF
#if -0xFFFFFFFF >= 0
#error "Interpreting the literal incorrectly in the preprocessor"
#endif
#endif
void dr266(void) {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wlong-long"
(void)sizeof(int[__SIZE_MAX__ / 2][__SIZE_MAX__ / 2]);
#pragma clang diagnostic pop
}
void dr272(void) {
const int * volatile ptr;
(void)_Generic(ptr = 0, const int * : 1);
}
void dr277(void) {
for (enum E { one, two } i = one; i < two; ++i)
;
}
#if __STDC_VERSION__ >= 199901L
void dr289(int * restrict const [restrict]);
#endif
struct NotCompleted;
void dr295_1(struct NotCompleted);
void dr295_1(struct NotCompleted Val) {
}
void dr295_2(void param);
#if __LLONG_WIDTH__ >= 64 && __LONG_WIDTH__ < 64
void dr298(void) {
(void)_Generic(9223372036854775808,
unsigned long long : 1);
(void)_Generic(9223372036854775807,
long long : 1);
}
#endif