diff options
Diffstat (limited to 'test/SemaCXX/default-assignment-operator.cpp')
-rw-r--r-- | test/SemaCXX/default-assignment-operator.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/SemaCXX/default-assignment-operator.cpp b/test/SemaCXX/default-assignment-operator.cpp index 090ba3c3ca..64ea49837b 100644 --- a/test/SemaCXX/default-assignment-operator.cpp +++ b/test/SemaCXX/default-assignment-operator.cpp @@ -72,3 +72,19 @@ void i() d1 = d2; } +// Test5 + +class E1 { // expected-error{{cannot define the implicit default assignment operator for 'class E1', because non-static const member 'a' can't use default assignment operator}} +public: + const int a; // expected-note{{declared at}} + E1() : a(0) {} + +}; + +E1 e1, e2; + +void j() +{ + e1 = e2; // expected-note{{synthesized method is first required here}} +} + |