blob: f43d438eb46fc72d5233acaf6e800a4dd4c4a70c [file] [log] [blame]
Daniel Dunbara5728872009-12-15 20:14:24 +00001// RUN: %clang_cc1 -fsyntax-only -pedantic -verify %s
Fariborz Jahanianf071e9b2009-10-23 21:01:39 +00002
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