diff options
author | Roman Divacky <rdivacky@FreeBSD.org> | 2009-11-18 14:59:57 +0000 |
---|---|---|
committer | Roman Divacky <rdivacky@FreeBSD.org> | 2009-11-18 14:59:57 +0000 |
commit | b3d5a323a5ca92ea73443499cee2f15db1ff0fb3 (patch) | |
tree | 60a1694bec5a44d15456acc880cb2f91619f66aa /test/SemaCXX/constructor-initializer.cpp | |
parent | 8f57cb0305232cb53fff00ef151ca716766f3437 (diff) |
Notes
Diffstat (limited to 'test/SemaCXX/constructor-initializer.cpp')
-rw-r--r-- | test/SemaCXX/constructor-initializer.cpp | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/test/SemaCXX/constructor-initializer.cpp b/test/SemaCXX/constructor-initializer.cpp index 20cf35b293b6..43186013aaa6 100644 --- a/test/SemaCXX/constructor-initializer.cpp +++ b/test/SemaCXX/constructor-initializer.cpp @@ -99,7 +99,9 @@ struct Current : Derived { // FIXME. This is bad message! struct M { // expected-note {{candidate function}} \ - // expected-note {{candidate function}} + // expected-note {{candidate function}} \ + // expected-note {{declared here}} \ + // expected-note {{declared here}} M(int i, int j); // expected-note {{candidate function}} \ // // expected-note {{candidate function}} }; @@ -110,9 +112,10 @@ struct N : M { M m1; }; -struct P : M { // expected-error {{default constructor for 'struct M' is missing in initialization of base class}} - P() { } - M m; // expected-error {{default constructor for 'struct M' is missing in initialization of member}} +struct P : M { + P() { } // expected-error {{base class 'struct M'}} \ + // expected-error {{member 'm'}} + M m; // expected-note {{member is declared here}} }; struct Q { @@ -155,3 +158,18 @@ class CopyConstructorTest { B(B), // expected-warning {{field is uninitialized when used here}} C(rhs.C || C) { } // expected-warning {{field is uninitialized when used here}} }; + +// Make sure we aren't marking default constructors when we shouldn't be. +template<typename T> +struct NDC { + T &ref; + + NDC() { } + NDC(T &ref) : ref(ref) { } +}; + +struct X0 : NDC<int> { + X0(int &ref) : NDC<int>(ref), ndc(ref) { } + + NDC<int> ndc; +}; |