Produce good looking diagnostics on ambiguous built-in operators.
Now we produce things like:
bug1.cpp:21:11: error: use of overloaded operator '->*' is ambiguous
        int i = c->*pmf;        // expected-error {{use of overloaded operator '->*' is ambiguous}} \
                ~^  ~~~
bug1.cpp:21:11: note: built-in candidate operator ->* ('struct A volatile *', 'int const struct A::*')
bug1.cpp:21:11: note: built-in candidate operator ->* ('struct A volatile *', 'int restrict struct A::*')
...

Still need to look at an issue (indicated as FIXME in the test case).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83650 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/SemaCXX/builtin-ptrtomember-ambig.cpp b/test/SemaCXX/builtin-ptrtomember-ambig.cpp
new file mode 100644
index 0000000..7e20af3
--- /dev/null
+++ b/test/SemaCXX/builtin-ptrtomember-ambig.cpp
@@ -0,0 +1,24 @@
+// RUN: clang-cc -fsyntax-only -verify %s -std=c++0x
+
+struct A {};
+
+struct R {
+    operator const A*();
+};
+
+
+struct B  : R {
+    operator A*();
+};
+
+struct C : B {
+
+};
+
+
+void foo(C c, int A::* pmf) {
+       				// FIXME. Why so many built-in candidates?
+	int i = c->*pmf; 	// expected-error {{use of overloaded operator '->*' is ambiguous}} \
+				// expected-note 40 {{built-in candidate operator ->* ('struct A}}
+}
+