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