fix PR8726 by teaching the aggregate init optimization code to handle 
structs with references in them correctly.

llvm-svn: 120722
diff --git a/clang/test/CodeGenCXX/value-init.cpp b/clang/test/CodeGenCXX/value-init.cpp
index c4eb1c8..48ea3ca 100644
--- a/clang/test/CodeGenCXX/value-init.cpp
+++ b/clang/test/CodeGenCXX/value-init.cpp
@@ -138,3 +138,16 @@
   // CHECK-NEXT: call void @_ZN8zeroinit2X2IiEC2Ev
   // CHECK-NEXT: ret void
 }
+
+namespace PR8726 {
+class C;
+struct S {
+  const C &c1;
+  int i;
+  const C &c2;
+};
+void f(const C& c) {
+  S s = {c, 42, c};
+}
+
+}
\ No newline at end of file