diff options
author | rdivacky <rdivacky@FreeBSD.org> | 2009-10-14 18:03:49 +0000 |
---|---|---|
committer | rdivacky <rdivacky@FreeBSD.org> | 2009-10-14 18:03:49 +0000 |
commit | 9092c3e0fa01f3139b016d05d267a89e3b07747a (patch) | |
tree | 137ebebcae16fb0ce7ab4af456992bbd8d22fced /test/SemaCXX/overloaded-operator.cpp | |
parent | 4981926bf654fe5a2c3893f24ca44106b217e71e (diff) | |
download | FreeBSD-src-9092c3e0fa01f3139b016d05d267a89e3b07747a.zip FreeBSD-src-9092c3e0fa01f3139b016d05d267a89e3b07747a.tar.gz |
Update clang to r84119.
Diffstat (limited to 'test/SemaCXX/overloaded-operator.cpp')
-rw-r--r-- | test/SemaCXX/overloaded-operator.cpp | 37 |
1 files changed, 34 insertions, 3 deletions
diff --git a/test/SemaCXX/overloaded-operator.cpp b/test/SemaCXX/overloaded-operator.cpp index 916d753..8f71ad5 100644 --- a/test/SemaCXX/overloaded-operator.cpp +++ b/test/SemaCXX/overloaded-operator.cpp @@ -28,12 +28,12 @@ void g(Y y, Z z) { } struct A { - bool operator==(Z&); // expected-note{{candidate function}} + bool operator==(Z&); // expected-note 2{{candidate function}} }; A make_A(); -bool operator==(A&, Z&); // expected-note{{candidate function}} +bool operator==(A&, Z&); // expected-note 2{{candidate function}} void h(A a, const A ac, Z z) { make_A() == z; @@ -155,7 +155,7 @@ typedef INTREF Func1(FLOAT, double); typedef float& Func2(int, double); struct ConvertToFunc { - operator Func1*(); // expected-note{{conversion candidate of type 'INTREF (*)(FLOAT, double)'}} + operator Func1*(); // expected-note{{conversion candidate of type 'INTREF (*)(float, double)'}} operator Func2&(); // expected-note{{conversion candidate of type 'float &(&)(int, double)'}} void operator()(); }; @@ -209,3 +209,34 @@ namespace M { (void)(x + x); } } + +struct AA { bool operator!=(AA&); }; +struct BB : AA {}; +bool x(BB y, BB z) { return y != z; } + + +struct AX { + AX& operator ->(); // expected-note {{declared at}} + int b; +}; + +void m() { + AX a; + a->b = 0; // expected-error {{circular pointer delegation detected}} +} + +struct CircA { + struct CircB& operator->(); // expected-note {{declared at}} + int val; +}; +struct CircB { + struct CircC& operator->(); // expected-note {{declared at}} +}; +struct CircC { + struct CircA& operator->(); // expected-note {{declared at}} +}; + +void circ() { + CircA a; + a->val = 0; // expected-error {{circular pointer delegation detected}} +} |