diff options
Diffstat (limited to 'test/SemaCXX/function-type-qual.cpp')
-rw-r--r-- | test/SemaCXX/function-type-qual.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/test/SemaCXX/function-type-qual.cpp b/test/SemaCXX/function-type-qual.cpp index be61f2ba5639..8ebb50607025 100644 --- a/test/SemaCXX/function-type-qual.cpp +++ b/test/SemaCXX/function-type-qual.cpp @@ -1,15 +1,17 @@ // RUN: %clang_cc1 -fsyntax-only -verify %s void f() const; // expected-error {{type qualifier is not allowed on this function}} +void (*pf)() const; // expected-error {{type qualifier is not allowed on this function pointer}} +void (&rf)() const = f; // expected-error {{type qualifier is not allowed on this function reference}} typedef void cfn() const; -cfn f2; // expected-error {{a qualified function type cannot be used to declare a nonmember function or a static member function}} +cfn f2; // expected-error {{a qualified function type cannot be used to declare a nonmember function}} class C { void f() const; cfn f2; static void f3() const; // expected-error {{type qualifier is not allowed on this function}} - static cfn f4; // expected-error {{a qualified function type cannot be used to declare a nonmember function or a static member function}} + static cfn f4; // expected-error {{a qualified function type cannot be used to declare a static member function}} void m1() { x = 0; @@ -21,3 +23,6 @@ class C { int x; }; + +void (C::*mpf)() const; +cfn C::*mpg; |