You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
644 B
24 lines
644 B
4 months ago
|
// RUN: %clang_cc1 -ast-dump %s | FileCheck %s
|
||
|
|
||
|
struct A { int x; };
|
||
|
struct B { int y; };
|
||
|
struct C : A, B { };
|
||
|
|
||
|
// CHECK: casting_away_constness
|
||
|
void casting_away_constness(const B &b, const C &c, const B *bp, const C *cp) {
|
||
|
// CHECK: DerivedToBase (B)
|
||
|
// CHECK: DeclRefExpr {{.*}} ParmVar {{.*}} 'c'
|
||
|
(void)(B&)c;
|
||
|
// CHECK: BaseToDerived (B)
|
||
|
// CHECK: DeclRefExpr {{.*}} ParmVar {{.*}} 'b'
|
||
|
(void)(C&)b;
|
||
|
// CHECK: DerivedToBase (B)
|
||
|
// CHECK: DeclRefExpr {{.*}} ParmVar {{.*}} 'cp'
|
||
|
(void)(B*)cp;
|
||
|
// CHECK: BaseToDerived (B)
|
||
|
// CHECK: DeclRefExpr {{.*}} ParmVar {{.*}} 'bp'
|
||
|
(void)(C*)bp;
|
||
|
// CHECK: ReturnStmt
|
||
|
return;
|
||
|
}
|