aboutsummaryrefslogtreecommitdiff
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, 18 insertions, 0 deletions
diff --git a/test/SemaCXX/ambiguous-builtin-unary-operator.cpp b/test/SemaCXX/ambiguous-builtin-unary-operator.cpp
new file mode 100644
index 000000000000..042546af6902
--- /dev/null
+++ b/test/SemaCXX/ambiguous-builtin-unary-operator.cpp
@@ -0,0 +1,18 @@
+// RUN: clang-cc -fsyntax-only -verify %s -std=c++0x
+
+struct A {
+ operator int&();
+};
+
+struct B {
+ operator long&();
+};
+
+struct C : B, A { };
+
+void test(C c) {
+ ++c; // expected-error {{use of overloaded operator '++' is ambiguous}}\
+ // expected-note 4 {{built-in candidate operator ++ (}}
+}
+
+