diff --git a/clang/include/clang/AST/DeclCXX.h b/clang/include/clang/AST/DeclCXX.h --- a/clang/include/clang/AST/DeclCXX.h +++ b/clang/include/clang/AST/DeclCXX.h @@ -2166,6 +2166,10 @@ llvm::PointerUnion Initializee; + /// The argument used to initialize the base or member, which may + /// end up constructing an object (when multiple arguments are involved). + Stmt *Init; + /// The source location for the field name or, for a base initializer /// pack expansion, the location of the ellipsis. /// @@ -2174,10 +2178,6 @@ /// Initializee points to the CXXConstructorDecl (to allow loop detection). SourceLocation MemberOrEllipsisLocation; - /// The argument used to initialize the base or member, which may - /// end up constructing an object (when multiple arguments are involved). - Stmt *Init; - /// Location of the left paren of the ctor-initializer. SourceLocation LParenLoc; diff --git a/clang/lib/AST/DeclCXX.cpp b/clang/lib/AST/DeclCXX.cpp --- a/clang/lib/AST/DeclCXX.cpp +++ b/clang/lib/AST/DeclCXX.cpp @@ -2506,16 +2506,15 @@ SourceLocation L, Expr *Init, SourceLocation R, SourceLocation EllipsisLoc) - : Initializee(TInfo), MemberOrEllipsisLocation(EllipsisLoc), Init(Init), + : Initializee(TInfo), Init(Init), MemberOrEllipsisLocation(EllipsisLoc), LParenLoc(L), RParenLoc(R), IsDelegating(false), IsVirtual(IsVirtual), IsWritten(false), SourceOrder(0) {} -CXXCtorInitializer::CXXCtorInitializer(ASTContext &Context, - FieldDecl *Member, +CXXCtorInitializer::CXXCtorInitializer(ASTContext &Context, FieldDecl *Member, SourceLocation MemberLoc, SourceLocation L, Expr *Init, SourceLocation R) - : Initializee(Member), MemberOrEllipsisLocation(MemberLoc), Init(Init), + : Initializee(Member), Init(Init), MemberOrEllipsisLocation(MemberLoc), LParenLoc(L), RParenLoc(R), IsDelegating(false), IsVirtual(false), IsWritten(false), SourceOrder(0) {} @@ -2524,7 +2523,7 @@ SourceLocation MemberLoc, SourceLocation L, Expr *Init, SourceLocation R) - : Initializee(Member), MemberOrEllipsisLocation(MemberLoc), Init(Init), + : Initializee(Member), Init(Init), MemberOrEllipsisLocation(MemberLoc), LParenLoc(L), RParenLoc(R), IsDelegating(false), IsVirtual(false), IsWritten(false), SourceOrder(0) {}