blob: f43d438eb46fc72d5233acaf6e800a4dd4c4a70c [file] [log] [blame]
Daniel Dunbar8fbe78f2009-12-15 20:14:24 +00001// RUN: %clang_cc1 -fsyntax-only -pedantic -verify %s
Fariborz Jahanian9a14b842009-10-23 21:01:39 +00002
Fariborz Jahanian1bc0f9a2009-11-18 21:54:48 +00003struct C {
4 static int (C::* a);
5};
Fariborz Jahanian9a14b842009-10-23 21:01:39 +00006
7typedef void (C::*pmfc)();
8
9void g(pmfc) {
10 C *c;
Fariborz Jahanian1bc0f9a2009-11-18 21:54:48 +000011 c->*pmfc(); // expected-error {{invalid use of pointer to member type after ->*}}
Fariborz Jahanian9a14b842009-10-23 21:01:39 +000012 C c1;
Fariborz Jahanian1bc0f9a2009-11-18 21:54:48 +000013 c1.*pmfc(); // expected-error {{invalid use of pointer to member type after .*}}
Fariborz Jahanianfff3fb22009-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 Jahanian1bc0f9a2009-11-18 21:54:48 +000016}
17
18int a(C* x) {
19 return x->*C::a;
Fariborz Jahanian9a14b842009-10-23 21:01:39 +000020}
21