From d7686ef31c21774bbfc5ce7c051f3d9bb13a78d4 Mon Sep 17 00:00:00 2001 From: Eli Friedman Date: Mon, 9 Nov 2009 01:05:47 +0000 Subject: Unify the codepaths used to verify base and member initializers for explicitly and implicitly defined constructors. This has a number of benefits: 1. Less code. 2. Explicit and implicit constructors get the same diagnostics. 3. The AST explicitly contains constructor calls from implicit default constructors. This allows handing some cases that previously weren't handled correctly in IRGen without any additional code. Specifically, implicit default constructors containing calls to constructors with default arguments are now handled correctly. llvm-svn: 86500 --- clang/test/SemaCXX/constructor-initializer.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'clang/test/SemaCXX/constructor-initializer.cpp') diff --git a/clang/test/SemaCXX/constructor-initializer.cpp b/clang/test/SemaCXX/constructor-initializer.cpp index 20cf35b293b..ec871764cf9 100644 --- a/clang/test/SemaCXX/constructor-initializer.cpp +++ b/clang/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 { -- cgit v1.2.3