diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2009-07-23 23:32:59 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2009-07-23 23:32:59 +0000 |
commit | 87595e46ccd61c9b7c08074c2c64b66b5c0fc694 (patch) | |
tree | 84c977aa048b47e1ab959647ec2c6811d04eedb3 /test/SemaCXX/constructor-initializer.cpp | |
parent | 00998a068e50945118f334c98af05ed44d7c22a6 (diff) |
Diagnose when base classes and members to be intialized
with constructors don't have a matching constructor.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76913 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaCXX/constructor-initializer.cpp')
-rw-r--r-- | test/SemaCXX/constructor-initializer.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/test/SemaCXX/constructor-initializer.cpp b/test/SemaCXX/constructor-initializer.cpp index 66a5f57e1c..71d38a1438 100644 --- a/test/SemaCXX/constructor-initializer.cpp +++ b/test/SemaCXX/constructor-initializer.cpp @@ -96,3 +96,23 @@ struct Current : Derived { INT::NonExisting() {} // expected-error {{expected a class or namespace}} \ // expected-error {{member initializer 'NonExisting' does not name a non-static data member or}} }; + + // FIXME. This is bad message! +struct M { // expected-note {{candidate function}} \ + // expected-note {{candidate function}} + M(int i, int j); // expected-note {{candidate function}} \ + // // expected-note {{candidate function}} +}; + +struct N : M { + N() : M(1), // expected-error {{no matching constructor for initialization of 'M'}} + m1(100) { } // expected-error {{no matching constructor for initialization of 'm1'}} + 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 mamber}} +}; + + |