From: Fariborz Jahanian Date: Tue, 1 Sep 2009 23:08:16 +0000 (+0000) Subject: After a conversation with Doug. I added a fix me to X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a4ad5ab45fb0990a5076614f3cfc2eae30ab9755;p=clang After a conversation with Doug. I added a fix me to where we build the constructor's initializer list. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80735 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/AST/DeclCXX.cpp b/lib/AST/DeclCXX.cpp index adcd3f9aa9..9642310406 100644 --- a/lib/AST/DeclCXX.cpp +++ b/lib/AST/DeclCXX.cpp @@ -609,6 +609,19 @@ CXXConstructorDecl::setBaseOrMemberInitializers( } if (HasDependentBaseInit) { + // FIXME. This does not preserve the ordering of the initializers. + // Try (with -Wreorder) + // template struct A {}; + // template struct B : A { + // B() : x1(10), A() {} + // int x1; + // }; + // B x; + // On seeing one dependent type, we should essentially exit this routine + // while preserving user-declared initializer list. When this routine is + // called during instantiatiation process, this routine will rebuild the + // oderdered initializer list correctly. + // If we have a dependent base initialization, we can't determine the // association between initializers and bases; just dump the known // initializers into the list, and don't try to deal with other bases.