1 // RUN: %clang_cc1 -fsyntax-only -verify %s
3 typedef void F() const;
5 void f() const; // expected-error {{non-member function cannot have 'const' qualifier}}
6 F g
; // expected-error {{non-member function of type 'F' (aka 'void () const') cannot have 'const' qualifier}}
10 friend void g() const; // expected-error {{non-member function cannot have 'const' qualifier}}
11 static void h() const; // expected-error {{static member function cannot have 'const' qualifier}}
13 friend F j
; // expected-error {{non-member function of type 'F' (aka 'void () const') cannot have 'const' qualifier}}
14 static F k
; // expected-error {{static member function of type 'F' (aka 'void () const') cannot have 'const' qualifier}}
18 friend void X::f() const;
19 friend void ::f() const; // expected-error {{non-member function cannot have 'const' qualifier}}
22 template<typename T
> struct S
{
24 typedef T
*P
; // expected-error {{pointer to function type 'void () const' cannot have 'const' qualifier}}
25 typedef T
&R
; // expected-error {{reference to function type 'void () const' cannot have 'const' qualifier}}
27 S
<F
> s
; // expected-note {{in instantiation of}}
29 // FIXME: This is ill-formed.
30 template<typename T
> struct U
{