Home | History | Annotate | Download | only in Sema
      1 // RUN: %clang_cc1 %s -verify -fsyntax-only
      2 typedef char T[4];
      3 
      4 T foo(int n, int m) {  }  // expected-error {{cannot return array type}}
      5 
      6 void foof(const char *, ...) __attribute__((__format__(__printf__, 1, 2))), barf (void);
      7 
      8 int typedef validTypeDecl() { } // expected-error {{function definition declared 'typedef'}}
      9 
     10 struct _zend_module_entry { }    // expected-error {{expected ';' after struct}}
     11 int gv1;
     12 typedef struct _zend_function_entry { } // expected-error {{expected ';' after struct}} \
     13                                         // expected-warning {{typedef requires a name}}
     14 int gv2;
     15 
     16 static void buggy(int *x) { }
     17 
     18 // Type qualifiers.
     19 typedef int f(void);
     20 typedef f* fptr;
     21 const f* v1;         // expected-warning {{qualifier on function type 'f' (aka 'int (void)') has unspecified behavior}}
     22 __restrict__ f* v2;  // expected-error {{restrict requires a pointer or reference ('f' (aka 'int (void)') is invalid)}}
     23 __restrict__ fptr v3; // expected-error {{pointer to function type 'f' (aka 'int (void)') may not be 'restrict' qualified}}
     24 f *__restrict__ v4;   // expected-error {{pointer to function type 'f' (aka 'int (void)') may not be 'restrict' qualified}}
     25 
     26 restrict struct hallo; // expected-error {{restrict requires a pointer or reference}}
     27 
     28 // PR6180
     29 struct test1 {
     30 } // expected-error {{expected ';' after struct}}
     31 
     32 void test2() {}
     33 
     34 
     35 // PR6423
     36 struct test3s {
     37 } // expected-error {{expected ';' after struct}}
     38 typedef int test3g;
     39