summaryrefslogtreecommitdiffstats
path: root/test/SemaCXX/ambiguous-builtin-unary-operator.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/SemaCXX/ambiguous-builtin-unary-operator.cpp')
-rw-r--r--test/SemaCXX/ambiguous-builtin-unary-operator.cpp18
1 files changed, 17 insertions, 1 deletions
diff --git a/test/SemaCXX/ambiguous-builtin-unary-operator.cpp b/test/SemaCXX/ambiguous-builtin-unary-operator.cpp
index 042546a..5affd19 100644
--- a/test/SemaCXX/ambiguous-builtin-unary-operator.cpp
+++ b/test/SemaCXX/ambiguous-builtin-unary-operator.cpp
@@ -2,17 +2,33 @@
struct A {
operator int&();
+ operator long*& ();
};
struct B {
operator long&();
+ operator int*& ();
};
struct C : B, A { };
void test(C c) {
++c; // expected-error {{use of overloaded operator '++' is ambiguous}}\
- // expected-note 4 {{built-in candidate operator ++ (}}
+ // expected-note {{built-in candidate operator++(int &)}} \
+ // expected-note {{built-in candidate operator++(long &)}} \
+ // expected-note {{built-in candidate operator++(long *&)}} \
+ // expected-note {{built-in candidate operator++(int *&)}}
}
+struct A1 { operator volatile int&(); };
+
+struct B1 { operator volatile long&(); };
+
+struct C1 : B1, A1 { };
+
+void test(C1 c) {
+ ++c; // expected-error {{use of overloaded operator '++' is ambiguous}} \
+ // expected-note {{built-in candidate operator++(int volatile &)}} \
+ // expected-note {{built-in candidate operator++(long volatile &)}}
+}
OpenPOWER on IntegriCloud