// RUN: %clang_cc1 -Wno-strict-prototypes %s -verify
void *; //expected-error{{'alloc_size' attribute takes at least 1 argument}}
void *; //expected-error{{'alloc_size' attribute takes at least 1 argument}}
void *; //expected-error{{'alloc_size' attribute parameter 1 is out of bounds}}
void *; //expected-error{{'alloc_size' attribute parameter 1 is out of bounds}}
void *; //expected-error{{'alloc_size' attribute parameter 1 is out of bounds}}
void *; //expected-error{{'alloc_size' attribute parameter 1 is out of bounds}}
void *; //expected-error{{'alloc_size' attribute parameter 2 is out of bounds}}
void *; //expected-error{{'alloc_size' attribute parameter 2 is out of bounds}}
int ; //expected-warning{{'alloc_size' attribute only applies to return values that are pointers}}
int fail10 ; //expected-warning{{'alloc_size' attribute only applies to non-K&R-style functions}}
void *; //expected-error{{'alloc_size' attribute argument may only refer to a function parameter of integer type}}
void *; //expected-error{{'alloc_size' attribute requires parameter 1 to be an integer constant}}
void *; //expected-error{{'alloc_size' attribute requires parameter 2 to be an integer constant}}
void *; //expected-error{{integer constant expression evaluates to value 2147483648 that cannot be represented in a 32-bit signed integer type}}
void *;
void *; //expected-warning{{'alloc_size' attribute only applies to non-K&R-style functions}}
// Applying alloc_size to function pointers should work:
void *;
void *;
// TODO: according to GCC documentation the following should actually be the type
// “pointer to pointer to alloc_size attributed function returning void*” and should
// therefore be supported
void *; // expected-warning{{'alloc_size' attribute only applies to non-K&R-style functions}}
// The following definitions apply the attribute to the pointer to the function pointer which should not be possible
void *; // expected-warning{{'alloc_size' attribute only applies to non-K&R-style functions}}
void *; // expected-warning{{'alloc_size' attribute only applies to non-K&R-style functions}}
// It should also work for typedefs:
typedef void *;
typedef void *;
void *;
// This typedef applies the alloc_size to the pointer to the function pointer and should not be allowed
void *; // expected-warning{{'alloc_size' attribute only applies to non-K&R-style functions}}
// We should not be warning when assigning function pointers with and without the alloc size attribute
// since it doesn't change the type of the function
typedef void *;
typedef void *;
void *;
void *;
int