summaryrefslogtreecommitdiffstats
path: root/test/CodeGenCXX/derived-to-base-conv.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/CodeGenCXX/derived-to-base-conv.cpp')
-rw-r--r--test/CodeGenCXX/derived-to-base-conv.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/test/CodeGenCXX/derived-to-base-conv.cpp b/test/CodeGenCXX/derived-to-base-conv.cpp
index c1a0caa..f2835b7 100644
--- a/test/CodeGenCXX/derived-to-base-conv.cpp
+++ b/test/CodeGenCXX/derived-to-base-conv.cpp
@@ -7,16 +7,21 @@ extern "C" int printf(...);
extern "C" void exit(int);
struct A {
- A (const A&) { printf("A::A(const A&)\n"); }
- A() {};
+ A (const A&) { printf("A::A(const A&)\n"); }
+ A() {};
+ ~A() { printf("A::~A()\n"); }
};
struct B : public A {
B() {};
-};
+ B(const B& Other) : A(Other) { printf("B::B(const B&)\n"); }
+ ~B() { printf("B::~B()\n"); }
+};
struct C : public B {
C() {};
+ C(const C& Other) : B(Other) { printf("C::C(const C&)\n"); }
+ ~C() { printf("C::~C()\n"); }
};
struct X {
@@ -24,6 +29,7 @@ struct X {
operator C&() {printf("X::operator C&()\n"); return c; }
X (const X&) { printf("X::X(const X&)\n"); }
X () { printf("X::X()\n"); }
+ ~X () { printf("X::~X()\n"); }
B b;
C c;
};
OpenPOWER on IntegriCloud