blob: 63b29c723e0724d03a3289e86997c25c70e87d51 [file] [log] [blame]
Fariborz Jahanianf071e9b2009-10-23 21:01:39 +00001// RUN: clang-cc -fsyntax-only -pedantic -verify %s
2
Fariborz Jahanian05ebda92009-11-18 21:54:48 +00003struct C {
4 static int (C::* a);
5};
Fariborz Jahanianf071e9b2009-10-23 21:01:39 +00006
7typedef void (C::*pmfc)();
8
9void g(pmfc) {
10 C *c;
Fariborz Jahanian05ebda92009-11-18 21:54:48 +000011 c->*pmfc(); // expected-error {{invalid use of pointer to member type after ->*}}
Fariborz Jahanianf071e9b2009-10-23 21:01:39 +000012 C c1;
Fariborz Jahanian05ebda92009-11-18 21:54:48 +000013 c1.*pmfc(); // expected-error {{invalid use of pointer to member type after .*}}
Fariborz Jahanian19d70732009-11-18 22:16:17 +000014 c->*(pmfc()); // expected-error {{invalid use of pointer to member type after ->*}}
15 c1.*((pmfc())); // expected-error {{invalid use of pointer to member type after .*}}
Fariborz Jahanian05ebda92009-11-18 21:54:48 +000016}
17
18int a(C* x) {
19 return x->*C::a;
Fariborz Jahanianf071e9b2009-10-23 21:01:39 +000020}
21