diff options
author | rdivacky <rdivacky@FreeBSD.org> | 2010-05-04 16:12:48 +0000 |
---|---|---|
committer | rdivacky <rdivacky@FreeBSD.org> | 2010-05-04 16:12:48 +0000 |
commit | 8aaf5818a64e9f7687798852af5945b053c68a54 (patch) | |
tree | d6a70c3518b8dea8be7062438d7e8676820ed17f /test/SemaCXX/default-assignment-operator.cpp | |
parent | 71438373cd57f0d5d8c93bb5cf690844a0fbc9d0 (diff) | |
download | FreeBSD-src-8aaf5818a64e9f7687798852af5945b053c68a54.zip FreeBSD-src-8aaf5818a64e9f7687798852af5945b053c68a54.tar.gz |
Update clang to r103004.
Diffstat (limited to 'test/SemaCXX/default-assignment-operator.cpp')
-rw-r--r-- | test/SemaCXX/default-assignment-operator.cpp | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/test/SemaCXX/default-assignment-operator.cpp b/test/SemaCXX/default-assignment-operator.cpp index baae03c..a04de37 100644 --- a/test/SemaCXX/default-assignment-operator.cpp +++ b/test/SemaCXX/default-assignment-operator.cpp @@ -1,13 +1,17 @@ // RUN: %clang_cc1 -fsyntax-only -verify %s -class Base { // expected-error {{cannot define the implicit default assignment operator for 'Base', because non-static reference member 'ref' can't use default assignment operator}} - int &ref; // expected-note {{declared at}} +class Base { // expected-error {{cannot define the implicit default assignment operator for 'Base', because non-static reference member 'ref' can't use default assignment operator}} \ + // expected-warning{{class 'Base' does not declare any constructor to initialize its non-modifiable members}} \ + // expected-note {{synthesized method is first required here}} + int &ref; // expected-note {{declared here}} \ + // expected-note{{reference member 'ref' will never be initialized}} }; -class X : Base { // // expected-error {{cannot define the implicit default assignment operator for 'X', because non-static const member 'cint' can't use default assignment operator}} +class X : Base { // // expected-error {{cannot define the implicit default assignment operator for 'X', because non-static const member 'cint' can't use default assignment operator}} \ + // expected-note {{synthesized method is first required here}} public: X(); - const int cint; // expected-note {{declared at}} + const int cint; // expected-note {{declared here}} }; struct Y : X { @@ -25,7 +29,7 @@ Z z2; // Test1 void f(X x, const X cx) { - x = cx; // expected-note 2 {{synthesized method is first required here}} + x = cx; x = cx; z1 = z2; } @@ -70,9 +74,11 @@ void i() { // Test5 -class E1 { // expected-error{{cannot define the implicit default assignment operator for 'E1', because non-static const member 'a' can't use default assignment operator}} +class E1 { // expected-error{{cannot define the implicit default assignment operator for 'E1', because non-static const member 'a' can't use default assignment operator}} \ + // expected-note {{synthesized method is first required here}} + public: - const int a; // expected-note{{declared at}} + const int a; // expected-note{{declared here}} E1() : a(0) {} }; @@ -80,6 +86,6 @@ public: E1 e1, e2; void j() { - e1 = e2; // expected-note{{synthesized method is first required here}} + e1 = e2; } |