diff options
author | Roman Divacky <rdivacky@FreeBSD.org> | 2009-10-14 18:03:49 +0000 |
---|---|---|
committer | Roman Divacky <rdivacky@FreeBSD.org> | 2009-10-14 18:03:49 +0000 |
commit | 4c8b24812ddcd1dedaca343a6d4e76f91f398981 (patch) | |
tree | 137ebebcae16fb0ce7ab4af456992bbd8d22fced /test/SemaCXX/ambiguous-builtin-unary-operator.cpp | |
parent | 5362a71c02e7d448a8ce98cf00c47e353fba5d04 (diff) |
Notes
Diffstat (limited to 'test/SemaCXX/ambiguous-builtin-unary-operator.cpp')
-rw-r--r-- | test/SemaCXX/ambiguous-builtin-unary-operator.cpp | 18 |
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 0000000000000..042546af69024 --- /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 ++ (}} +} + + |