diff options
| author | Roman Divacky <rdivacky@FreeBSD.org> | 2010-05-04 20:51:19 +0000 |
|---|---|---|
| committer | Roman Divacky <rdivacky@FreeBSD.org> | 2010-05-04 20:51:19 +0000 |
| commit | be17651f5cd2e94922c1b732bc8589e180698193 (patch) | |
| tree | 938fcb7c80a0402925b5b00fa684a245ab0936a5 /test/SemaCXX/default-assignment-operator.cpp | |
| parent | 0883ccd9eac3b974df00e6548ee319a7dd3646f4 (diff) | |
Notes
Diffstat (limited to 'test/SemaCXX/default-assignment-operator.cpp')
| -rw-r--r-- | test/SemaCXX/default-assignment-operator.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/test/SemaCXX/default-assignment-operator.cpp b/test/SemaCXX/default-assignment-operator.cpp index a04de37fcb6a..dee6d131e4ad 100644 --- a/test/SemaCXX/default-assignment-operator.cpp +++ b/test/SemaCXX/default-assignment-operator.cpp @@ -89,3 +89,31 @@ void j() { e1 = e2; } +namespace ProtectedCheck { + struct X { + protected: + X &operator=(const X&); // expected-note{{declared protected here}} + }; + + struct Y : public X { }; + + void f(Y y) { y = y; } + + struct Z { // expected-error{{'operator=' is a protected member of 'ProtectedCheck::X'}} + X x; + }; + + void f(Z z) { z = z; } // +} + +namespace MultiplePaths { + struct X0 { + X0 &operator=(const X0&); + }; + + struct X1 : public virtual X0 { }; + + struct X2 : X0, X1 { }; + + void f(X2 x2) { x2 = x2; } +} |
