Issue good diagnostics when initialization failes due to
ambiguity in type conversion function selection.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81898 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/SemaCXX/direct-initializer.cpp b/test/SemaCXX/direct-initializer.cpp
index 149b65c..e95ba22 100644
--- a/test/SemaCXX/direct-initializer.cpp
+++ b/test/SemaCXX/direct-initializer.cpp
@@ -34,3 +34,17 @@
Z z; // expected-error{{no matching constructor for initialization of 'z'}}
}
+
+struct Base {
+ operator int*() const; // expected-note {{candidate function}}
+};
+
+struct Derived : Base {
+ operator int*(); // expected-note {{candidate function}}
+};
+
+void foo(const Derived cd, Derived d) {
+ int *pi = cd;
+ int *ppi = d; // expected-error {{ambiguity in initializing value of type 'int *' with initializer of type 'struct Derived'}}
+
+}