Daniel Dunbar | a572887 | 2009-12-15 20:14:24 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fsyntax-only -pedantic -verify %s |
Fariborz Jahanian | f071e9b | 2009-10-23 21:01:39 +0000 | [diff] [blame] | 2 | |
Fariborz Jahanian | 05ebda9 | 2009-11-18 21:54:48 +0000 | [diff] [blame] | 3 | struct C { |
| 4 | static int (C::* a); |
| 5 | }; |
Fariborz Jahanian | f071e9b | 2009-10-23 21:01:39 +0000 | [diff] [blame] | 6 | |
| 7 | typedef void (C::*pmfc)(); |
| 8 | |
| 9 | void g(pmfc) { |
| 10 | C *c; |
Fariborz Jahanian | 05ebda9 | 2009-11-18 21:54:48 +0000 | [diff] [blame] | 11 | c->*pmfc(); // expected-error {{invalid use of pointer to member type after ->*}} |
Fariborz Jahanian | f071e9b | 2009-10-23 21:01:39 +0000 | [diff] [blame] | 12 | C c1; |
Fariborz Jahanian | 05ebda9 | 2009-11-18 21:54:48 +0000 | [diff] [blame] | 13 | c1.*pmfc(); // expected-error {{invalid use of pointer to member type after .*}} |
Fariborz Jahanian | 19d7073 | 2009-11-18 22:16:17 +0000 | [diff] [blame] | 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 .*}} |
Fariborz Jahanian | 05ebda9 | 2009-11-18 21:54:48 +0000 | [diff] [blame] | 16 | } |
| 17 | |
| 18 | int a(C* x) { |
| 19 | return x->*C::a; |
Fariborz Jahanian | f071e9b | 2009-10-23 21:01:39 +0000 | [diff] [blame] | 20 | } |
| 21 | |