2008-12-13 03:20:14 +08:00
|
|
|
// RUN: clang -fsyntax-only -verify -pedantic -fblocks %s
|
2008-08-21 06:07:34 +08:00
|
|
|
|
2008-12-12 14:19:11 +08:00
|
|
|
// PR2241
|
|
|
|
float test2241[] = {
|
|
|
|
1e, // expected-error {{exponent}}
|
|
|
|
1ee0 // expected-error {{exponent}}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2008-08-21 06:07:34 +08:00
|
|
|
// Testcase derived from PR2692
|
|
|
|
static char *f (char * (*g) (char **, int), char **p, ...) {
|
|
|
|
char *s;
|
|
|
|
va_list v; // expected-error {{identifier}}
|
|
|
|
s = g (p, __builtin_va_arg(v, int)); // expected-error {{identifier}} expected-warning {{extension}}
|
|
|
|
}
|
|
|
|
|
2008-12-09 05:59:01 +08:00
|
|
|
|
|
|
|
// PR3172
|
|
|
|
} // expected-error {{expected external declaration}}
|
|
|
|
|
|
|
|
|
2008-12-12 14:19:11 +08:00
|
|
|
// rdar://6094870
|
2008-12-17 15:32:46 +08:00
|
|
|
int test(int a) {
|
2008-12-12 14:19:11 +08:00
|
|
|
struct { int i; } x;
|
|
|
|
|
|
|
|
if (x.hello) // expected-error {{no member named 'hello'}}
|
|
|
|
test(0);
|
|
|
|
else
|
|
|
|
;
|
|
|
|
|
|
|
|
if (x.hello == 0) // expected-error {{no member named 'hello'}}
|
|
|
|
test(0);
|
|
|
|
else
|
|
|
|
;
|
|
|
|
|
|
|
|
if ((x.hello == 0)) // expected-error {{no member named 'hello'}}
|
|
|
|
test(0);
|
|
|
|
else
|
|
|
|
;
|
|
|
|
|
|
|
|
if (x.i == 0)) // expected-error {{expected expression}}
|
|
|
|
test(0);
|
|
|
|
else
|
|
|
|
;
|
|
|
|
}
|
|
|
|
|
2008-12-12 14:21:18 +08:00
|
|
|
|
|
|
|
|
|
|
|
char (((( /* expected-note {{to match this '('}} */
|
|
|
|
*X x ] )))); /* expected-error {{expected ')'}} */
|
|
|
|
|
|
|
|
; // expected-warning {{ISO C does not allow an extra ';' outside of a function}}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct S { void *X, *Y; };
|
|
|
|
|
|
|
|
struct S A = {
|
|
|
|
&BADIDENT, 0 /* expected-error {{use of undeclared identifier}} */
|
|
|
|
};
|
2008-12-13 03:20:14 +08:00
|
|
|
|
|
|
|
// rdar://6248081
|
|
|
|
int test6248081() {
|
|
|
|
[10] // expected-error {{expected expression}}
|
|
|
|
}
|
|
|
|
|
2009-01-20 03:26:10 +08:00
|
|
|
struct forward; // expected-note{{forward declaration of 'struct forward'}}
|
2008-12-18 06:22:03 +08:00
|
|
|
void x(struct forward* x) {switch(x->a) {}} // expected-error {{incomplete definition of type}}
|
2008-12-18 06:19:57 +08:00
|
|
|
|