1 // RUN: %clang_cc1 -ast-dump %s | FileCheck %s
2
3 struct A { int x; };
4 struct B { int y; };
5 struct C : A, B { };
6
7 // CHECK: casting_away_constness
casting_away_constness(const B & b,const C & c,const B * bp,const C * cp)8 void casting_away_constness(const B &b, const C &c, const B *bp, const C *cp) {
9 // CHECK: DerivedToBase (B)
10 // CHECK: DeclRefExpr {{.*}} ParmVar {{.*}} 'c'
11 (void)(B&)c;
12 // CHECK: BaseToDerived (B)
13 // CHECK: DeclRefExpr {{.*}} ParmVar {{.*}} 'b'
14 (void)(C&)b;
15 // CHECK: DerivedToBase (B)
16 // CHECK: DeclRefExpr {{.*}} ParmVar {{.*}} 'cp'
17 (void)(B*)cp;
18 // CHECK: BaseToDerived (B)
19 // CHECK: DeclRefExpr {{.*}} ParmVar {{.*}} 'bp'
20 (void)(C*)bp;
21 // CHECK: ReturnStmt
22 return;
23 }
24