Restore the lvalue-to-rvalue conversion patch with a minimal fix.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120555 91177308-0d34-0410-b5e6-96231b3b80d8
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 @@
 
 }
 
+// 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());
+  }
+}