Cedric Venet | 3d65864 | 2009-02-14 20:20:19 +0000 | [diff] [blame^] | 1 | // RUN: clang -fsyntax-only -verify %s |
| 2 | |
| 3 | void f() const; // expected-error {{type qualifier is not allowed on this function}} |
| 4 | |
| 5 | typedef void cfn() const; |
| 6 | cfn f2; // expected-error {{a qualified function type cannot be used to declare a nonmember function or a static member function}} |
| 7 | |
| 8 | class 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 | }; |