Be more careful when checking initializer lists that involve reference
types; we don't want to give an expression reference type. Fixes PR6177.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95635 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/SemaCXX/decl-init-ref.cpp b/test/SemaCXX/decl-init-ref.cpp
index 656f343..e1c7711 100644
--- a/test/SemaCXX/decl-init-ref.cpp
+++ b/test/SemaCXX/decl-init-ref.cpp
@@ -24,3 +24,6 @@
         const A& rca = f(); // expected-error {{reference initialization of type 'struct A const &' with initializer of type 'class B' is ambiguous}}
         A& ra = f(); // expected-error {{non-const lvalue reference to type 'struct A' cannot bind to a temporary of type 'class B'}}
 }
+
+struct PR6177 { A (&x)[1]; };
+PR6177 x = {{A()}}; // expected-error{{non-const lvalue reference to type 'struct A [1]' cannot bind to a temporary of type 'struct A'}}