blob: d5f9347ece39d6571af9ddef4e0f5675c39b8800 [file] [log] [blame]
Douglas Gregor82d44772008-12-20 23:49:58 +00001// RUN: clang -fsyntax-only -verify %s
2
3class X{
4public:
5 enum E {Enumerator};
6 int f();
7 static int mem;
8 static float g();
9};
10
11void test(X* xp, X x) {
12 int i1 = x.f();
13 int i2 = xp->f();
14 x.E; // expected-error{{cannot refer to type member 'E' with '.'}}
15 xp->E; // expected-error{{cannot refer to type member 'E' with '->'}}
Douglas Gregor62b55042009-01-16 03:02:29 +000016 int i3 = x.Enumerator;
17 int i4 = xp->Enumerator;
Douglas Gregor82d44772008-12-20 23:49:58 +000018 x.mem = 1;
19 xp->mem = 2;
20 float f1 = x.g();
21 float f2 = xp->g();
22}