1 // RUN: %clang_cc1 -fsyntax-only -verify %s 2 3 void f() const; // expected-error {{type qualifier is not allowed on this function}} 4 void (*pf)() const; // expected-error {{type qualifier is not allowed on this function pointer}} 5 void (&rf)() const = f; // expected-error {{type qualifier is not allowed on this function reference}} 6 7 typedef void cfn() const; 8 cfn f2; // expected-error {{a qualified function type cannot be used to declare a nonmember function}} 9 10 class C { 11 void f() const; 12 cfn f2; 13 static void f3() const; // expected-error {{type qualifier is not allowed on this function}} 14 static cfn f4; // expected-error {{a qualified function type cannot be used to declare a static member function}} 15 16 void m1() { 17 x = 0; 18 } 19 20 void m2() const { 21 x = 0; // expected-error {{read-only variable is not assignable}} 22 } 23 24 int x; 25 }; 26 27 void (C::*mpf)() const; 28 cfn C::*mpg; 29