blob: be61f2ba5639525d0d411fb047c5d2dfe10756f7 [file] [log] [blame]
Daniel Dunbara5728872009-12-15 20:14:24 +00001// RUN: %clang_cc1 -fsyntax-only -verify %s
Cedric Venet3d658642009-02-14 20:20:19 +00002
3void f() const; // expected-error {{type qualifier is not allowed on this function}}
4
5typedef void cfn() const;
6cfn f2; // expected-error {{a qualified function type cannot be used to declare a nonmember function or a static member function}}
7
8class C {
9 void f() const;
10 cfn f2;
11 static void f3() const; // expected-error {{type qualifier is not allowed on this function}}
12 static cfn f4; // expected-error {{a qualified function type cannot be used to declare a nonmember function or a static member function}}
13
14 void m1() {
15 x = 0;
16 }
17
18 void m2() const {
19 x = 0; // expected-error {{read-only variable is not assignable}}
20 }
21
22 int x;
23};