summaryrefslogtreecommitdiffstats
path: root/test/CodeGenCXX/derived-to-base.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/CodeGenCXX/derived-to-base.cpp')
-rw-r--r--test/CodeGenCXX/derived-to-base.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/CodeGenCXX/derived-to-base.cpp b/test/CodeGenCXX/derived-to-base.cpp
index e44fdc5..76b79fc 100644
--- a/test/CodeGenCXX/derived-to-base.cpp
+++ b/test/CodeGenCXX/derived-to-base.cpp
@@ -34,3 +34,14 @@ A *f(B* b) {
}
+// Don't crash on a derived-to-base conversion of an r-value
+// aggregate.
+namespace test3 {
+ struct A {};
+ struct B : A {};
+
+ void foo(A a);
+ void test() {
+ foo(B());
+ }
+}
OpenPOWER on IntegriCloud