blob: 337972fd149bb97ff40e2f33d4a949bdf5e4386e [file] [log] [blame]
Daniel Dunbara5728872009-12-15 20:14:24 +00001/* RUN: %clang_cc1 -fsyntax-only %s -verify
Reid Spencer5f016e22007-07-11 17:01:13 +00002 */
3
4typedef void Void;
5
6void foo() {
7 int X;
8
Eli Friedman6d1e4b52008-05-22 08:54:03 +00009 X = sizeof(int (void a)); // expected-error {{argument may not have 'void' type}}
10 X = sizeof(int (int, void)); // expected-error {{must be the first and only parameter}}
11 X = sizeof(int (void, ...)); // expected-error {{must be the first and only parameter}}
Reid Spencer5f016e22007-07-11 17:01:13 +000012
Eli Friedman6d1e4b52008-05-22 08:54:03 +000013 X = sizeof(int (Void a)); // expected-error {{argument may not have 'void' type}}
14 X = sizeof(int (int, Void)); // expected-error {{must be the first and only parameter}}
15 X = sizeof(int (Void, ...)); // expected-error {{must be the first and only parameter}}
Reid Spencer5f016e22007-07-11 17:01:13 +000016
17 // Accept these.
18 X = sizeof(int (void));
19 X = sizeof(int (Void));
20}
21
Chris Lattnerb751c282007-11-28 18:51:29 +000022// this is ok.
23void bar(Void) {
24}
25
Eli Friedman6d1e4b52008-05-22 08:54:03 +000026void f(const void); // expected-error {{parameter must not have type qualifiers}}