2009-12-16 04:14:24 +08:00
|
|
|
// RUN: %clang_cc1 -fsyntax-only -pedantic -verify %s
|
2009-10-24 05:01:39 +08:00
|
|
|
|
2009-11-19 05:54:48 +08:00
|
|
|
struct C {
|
|
|
|
static int (C::* a);
|
|
|
|
};
|
2009-10-24 05:01:39 +08:00
|
|
|
|
|
|
|
typedef void (C::*pmfc)();
|
|
|
|
|
|
|
|
void g(pmfc) {
|
|
|
|
C *c;
|
2009-11-19 05:54:48 +08:00
|
|
|
c->*pmfc(); // expected-error {{invalid use of pointer to member type after ->*}}
|
2009-10-24 05:01:39 +08:00
|
|
|
C c1;
|
2009-11-19 05:54:48 +08:00
|
|
|
c1.*pmfc(); // expected-error {{invalid use of pointer to member type after .*}}
|
2009-11-19 06:16:17 +08:00
|
|
|
c->*(pmfc()); // expected-error {{invalid use of pointer to member type after ->*}}
|
|
|
|
c1.*((pmfc())); // expected-error {{invalid use of pointer to member type after .*}}
|
2009-11-19 05:54:48 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
int a(C* x) {
|
|
|
|
return x->*C::a;
|
2009-10-24 05:01:39 +08:00
|
|
|
}
|
|
|
|
|