This patch addresses a few issues related to 8.5.3 [dcl.init.ref]
It uses a recent API to find inherited conversion functions to do
the initializer to reference lvalue conversion (and removes a FIXME).
It issues the ambiguity diagnostics when multiple conversions are found.
WIP.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82649 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/SemaCXX/decl-init-ref.cpp b/test/SemaCXX/decl-init-ref.cpp
new file mode 100644
index 0000000..a87c0ef
--- /dev/null
+++ b/test/SemaCXX/decl-init-ref.cpp
@@ -0,0 +1,24 @@
+// RUN: clang-cc -fsyntax-only -verify -std=c++0x %s
+
+struct A {};    // expected-note {{candidate function}}
+
+struct BASE {
+  operator A(); // expected-note {{candidate function}}
+};
+
+struct BASE1 {
+ operator A();  // expected-note {{candidate function}}
+};
+
+class B : public BASE , public BASE1
+{
+  public:
+  B();
+} b;
+
+extern B f();
+
+int main() {
+        const A& rca = f(); // expected-error {{rvalue reference cannot bind to lvalue due to multiple conversion functions}}
+        A& ra = f(); // expected-error {{non-const lvalue reference to type 'struct A' cannot be initialized with a temporary of type 'class B'}}
+}