Fix the clang-wpa example.
[clang.git] / test / SemaCXX / member-pointers-2.cpp
blob4b3b82c0297539bd71176607abc85109c411662b
1 // RUN: %clang_cc1 -emit-llvm-only %s
3 // Tests that Sema properly creates member-access expressions for
4 // these instead of bare FieldDecls.
6 struct Foo {
7 int myvalue;
9 // We have to override these to get something with an lvalue result.
10 int &operator++(int);
11 int &operator--(int);
14 struct Test0 {
15 Foo memfoo;
16 int memint;
17 int memarr[10];
18 Test0 *memptr;
19 struct MemClass { int a; } memstruct;
20 int &memfun();
22 void test() {
23 int *p;
24 p = &Test0::memfoo++;
25 p = &Test0::memfoo--;
26 p = &Test0::memarr[1];
27 p = &Test0::memptr->memint;
28 p = &Test0::memstruct.a;
29 p = &Test0::memfun();
33 void test0() {
34 Test0 mytest;
35 mytest.test();