22 lines · cpp
1// RUN: %clang_cc1 -fsyntax-only -pedantic -verify %s2 3struct C {4 static int (C::* a);5};6 7typedef void (C::*pmfc)();8 9void 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 18int a(C* x) { 19 return x->*C::a; 20}21 22