Add LLVM runtime checks to build path
[clang/acc.git] / test / SemaCXX / member-expr.cpp
blob28b1224d8d8fbfef78d658bcbab501e49a501367
1 // RUN: clang-cc -fsyntax-only -verify %s
3 class X{
4 public:
5 enum E {Enumerator};
6 int f();
7 static int mem;
8 static float g();
9 };
11 void 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 '->'}}
16 int i3 = x.Enumerator;
17 int i4 = xp->Enumerator;
18 x.mem = 1;
19 xp->mem = 2;
20 float f1 = x.g();
21 float f2 = xp->g();
24 struct A {
25 int f0;
27 struct B {
28 A *f0();
30 int f0(B *b) {
31 return b->f0->f0; // expected-error{{member reference base type 'struct A *()' is not a structure or union}} \
32 // expected-note{{perhaps you meant to call this function}}