aboutsummaryrefslogtreecommitdiff
path: root/test/SemaCXX/member-expr.cpp
blob: 0175bd6f13826d329d51ccff8f16ff0ac620f21c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// RUN: clang -fsyntax-only -verify %s

class X{
public:
  enum E {Enumerator};
  int f();
  static int mem;
  static float g();
};

void test(X* xp, X x) {
  int i1 = x.f();
  int i2 = xp->f();
  x.E; // expected-error{{cannot refer to type member 'E' with '.'}}
  xp->E; // expected-error{{cannot refer to type member 'E' with '->'}}
  // FIXME: lookup needs to find enumerators  int i3 = x.Enumerator;
  // FIXME:  int i4 = xp->Enumerator;
  x.mem = 1;
  xp->mem = 2;
  float f1 = x.g();
  float f2 = xp->g();
}