| Chris Lattner | ea72f44 | 2007-12-19 05:31:29 +0000 | [diff] [blame] | 1 | // RUN: clang %s -verify -fsyntax-only | 
|  | 2 | typedef char T[4]; | 
|  | 3 |  | 
|  | 4 | T foo(int n, int m) {  }  // expected-error {{cannot return array or function}} | 
|  | 5 |  | 
| Steve Naroff | 1aa1941 | 2008-01-17 00:36:28 +0000 | [diff] [blame] | 6 | void foof(const char *, ...) __attribute__((__format__(__printf__, 1, 2))), barf (void); | 
|  | 7 |  | 
| Steve Naroff | f631997 | 2008-02-14 02:58:32 +0000 | [diff] [blame] | 8 | int typedef validTypeDecl() { } // expected-error {{function definition declared 'typedef'}} | 
|  | 9 |  | 
| Steve Naroff | ab468cb | 2008-02-12 04:08:59 +0000 | [diff] [blame] | 10 | struct _zend_module_entry { } | 
|  | 11 | typedef struct _zend_function_entry { } // expected-error {{cannot combine with previous 'struct' declaration specifier}} | 
| Steve Naroff | f631997 | 2008-02-14 02:58:32 +0000 | [diff] [blame] | 12 | static void buggy(int *x) { } // expected-error {{function definition declared 'typedef'}} \ | 
|  | 13 | // expected-error {{cannot combine with previous 'typedef' declaration specifier}} \ | 
|  | 14 | // expected-error {{cannot combine with previous 'struct' declaration specifier}} | 
|  | 15 |  | 
| Chris Lattner | daaa8ba | 2008-04-02 06:50:17 +0000 | [diff] [blame] | 16 | // Type qualifiers. | 
|  | 17 | typedef int f(void); | 
|  | 18 | typedef f* fptr; | 
|  | 19 | const f* v1;         // expected-warning {{qualifier on function type 'f' has unspecified behavior}} | 
|  | 20 | __restrict__ f* v2;  // expected-error {{restrict requires a pointer or reference ('f' is invalid)}} | 
| Chris Lattner | 1e5665e | 2008-11-24 06:25:27 +0000 | [diff] [blame^] | 21 | __restrict__ fptr v3; // expected-error {{pointer to function type 'f' may not be 'restrict' qualified}} | 
|  | 22 | f *__restrict__ v4;   // expected-error {{pointer to function type 'f' may not be 'restrict' qualified}} | 
| Steve Naroff | f631997 | 2008-02-14 02:58:32 +0000 | [diff] [blame] | 23 |  |