blob: 6799146a5ff98181fec7821a2709ebd9dd4999e2 [file] [log] [blame]
Daniel Dunbard7d5f022009-03-24 02:24:46 +00001/* RUN: clang-cc -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}}