1 | // RUN: %clang_cc1 -fsyntax-only -pedantic -verify %s |
2 | |
3 | struct C { |
4 | static int (C::* a); |
5 | }; |
6 | |
7 | typedef void (C::*pmfc)(); |
8 | |
9 | void g(pmfc) { |
10 | C *c; |
11 | c->*pmfc(); // expected-error {{invalid use of pointer to member type after ->*}} |
12 | C c1; |
13 | c1.*pmfc(); // expected-error {{invalid use of pointer to member type after .*}} |
14 | 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 .*}} |
16 | } |
17 | |
18 | int a(C* x) { |
19 | return x->*C::a; |
20 | } |
21 | |
22 | |