2008-05-22 16:54:03 +08:00
|
|
|
/* RUN: clang -fsyntax-only %s -verify
|
2006-12-03 10:43:54 +08:00
|
|
|
*/
|
|
|
|
|
|
|
|
typedef void Void;
|
|
|
|
|
|
|
|
void foo() {
|
|
|
|
int X;
|
|
|
|
|
2008-05-22 16:54:03 +08:00
|
|
|
X = sizeof(int (void a)); // expected-error {{argument may not have 'void' type}}
|
|
|
|
X = sizeof(int (int, void)); // expected-error {{must be the first and only parameter}}
|
|
|
|
X = sizeof(int (void, ...)); // expected-error {{must be the first and only parameter}}
|
2006-12-03 10:43:54 +08:00
|
|
|
|
2008-05-22 16:54:03 +08:00
|
|
|
X = sizeof(int (Void a)); // expected-error {{argument may not have 'void' type}}
|
|
|
|
X = sizeof(int (int, Void)); // expected-error {{must be the first and only parameter}}
|
|
|
|
X = sizeof(int (Void, ...)); // expected-error {{must be the first and only parameter}}
|
2006-12-03 10:43:54 +08:00
|
|
|
|
|
|
|
// Accept these.
|
|
|
|
X = sizeof(int (void));
|
|
|
|
X = sizeof(int (Void));
|
|
|
|
}
|
|
|
|
|
2007-11-29 02:51:29 +08:00
|
|
|
// this is ok.
|
|
|
|
void bar(Void) {
|
|
|
|
}
|
|
|
|
|
2008-05-22 16:54:03 +08:00
|
|
|
void f(const void); // expected-error {{parameter must not have type qualifiers}}
|