]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/SemaCXX/function-type-qual.cpp
Update clang to r86140.
[FreeBSD/FreeBSD.git] / test / SemaCXX / function-type-qual.cpp
1 // RUN: clang-cc -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 };