summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/builtin-ptrtomember-overload-1.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2009-10-12 17:51:19 +0000
committerFariborz Jahanian <fjahanian@apple.com>2009-10-12 17:51:19 +0000
commit574de2c5a4f025808eda36c55f871f78d585dc96 (patch)
treea7b10e0c18d8ad0a237fc52e55e6f69cf7ca3045 /clang/test/SemaCXX/builtin-ptrtomember-overload-1.cpp
parent406ac811ab1e42f39d00b45f0656e738686e972f (diff)
downloadbcm5719-llvm-574de2c5a4f025808eda36c55f871f78d585dc96.tar.gz
bcm5719-llvm-574de2c5a4f025808eda36c55f871f78d585dc96.zip
If built-in operators could not be selected because of ambiguity in
user-defined type conversions, issue list of ambiguites in addition to the diagnostic. So, clang now issues the following: b.cpp:19:19: error: left hand operand to ->* must be a pointer to class compatible with the right hand operand, but is 'struct C1' int i = c1->*pmf; ~~^ b.cpp:19:19: note: because of ambiguity in conversion of 'struct C1' to 'struct E *' b.cpp:5:5: note: candidate function operator E*(); ^ b.cpp:11:5: note: candidate function operator E*(); ^ llvm-svn: 83862
Diffstat (limited to 'clang/test/SemaCXX/builtin-ptrtomember-overload-1.cpp')
-rw-r--r--clang/test/SemaCXX/builtin-ptrtomember-overload-1.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/clang/test/SemaCXX/builtin-ptrtomember-overload-1.cpp b/clang/test/SemaCXX/builtin-ptrtomember-overload-1.cpp
index 46c8ae8b6b9..27ca6dc7789 100644
--- a/clang/test/SemaCXX/builtin-ptrtomember-overload-1.cpp
+++ b/clang/test/SemaCXX/builtin-ptrtomember-overload-1.cpp
@@ -5,13 +5,13 @@ struct E {};
struct R {
operator A*();
- operator E*();
+ operator E*(); // expected-note{{candidate function}}
};
struct S {
operator A*();
- operator E*();
+ operator E*(); // expected-note{{candidate function}}
};
struct B : R {
@@ -41,5 +41,6 @@ void foo1(C1 c1, int A::* pmf) {
void foo1(C1 c1, int E::* pmf) {
// FIXME. Error reporting needs much improvement here.
- int i = c1->*pmf; // expected-error {{left hand operand to ->* must be a pointer to class compatible with the right hand operand, but is 'struct C1'}}
+ int i = c1->*pmf; // expected-error {{left hand operand to ->* must be a pointer to class compatible with the right hand operand, but is 'struct C1'}} \
+ // expected-note {{because of ambiguity in conversion of 'struct C1' to 'struct E *'}}
}
OpenPOWER on IntegriCloud