]> granicus.if.org Git - clang/commitdiff
After a conversation with Doug. I added a fix me to
authorFariborz Jahanian <fjahanian@apple.com>
Tue, 1 Sep 2009 23:08:16 +0000 (23:08 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Tue, 1 Sep 2009 23:08:16 +0000 (23:08 +0000)
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

lib/AST/DeclCXX.cpp

index adcd3f9aa92e826545ea6e84f52509bedd936cb5..96423104065be8e3f7fd3545a6528a84469aa53d 100644 (file)
@@ -609,6 +609,19 @@ CXXConstructorDecl::setBaseOrMemberInitializers(
   }
 
   if (HasDependentBaseInit) {
+    // FIXME. This does not preserve the ordering of the initializers.
+    // Try (with -Wreorder)
+    // template<class X> struct A {};
+    // template<class X> struct B : A<X> { 
+    //   B() : x1(10), A<X>() {} 
+    //   int x1;
+    // };
+    // B<int> 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.