From 0849d38128536b0b33377d91bf02d005308319ef Mon Sep 17 00:00:00 2001 From: Fariborz Jahanian Date: Tue, 14 Jul 2009 20:06:22 +0000 Subject: [PATCH] Build AST for default ctor-initializer when constructor has out of line definition. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75668 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Parse/ParseCXXInlineMethods.cpp | 3 +-- lib/Parse/Parser.cpp | 2 ++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/Parse/ParseCXXInlineMethods.cpp b/lib/Parse/ParseCXXInlineMethods.cpp index a2324ab28e..8dcf24f86a 100644 --- a/lib/Parse/ParseCXXInlineMethods.cpp +++ b/lib/Parse/ParseCXXInlineMethods.cpp @@ -171,9 +171,8 @@ void Parser::ParseLexedMethodDefs(ParsingClass &Class) { } if (Tok.is(tok::colon)) ParseConstructorInitializer(LM.D); - else { + else Actions.ActOnDefaultInitializers(LM.D); - } // FIXME: What if ParseConstructorInitializer doesn't leave us with a '{'?? ParseFunctionStatementBody(LM.D); diff --git a/lib/Parse/Parser.cpp b/lib/Parse/Parser.cpp index 9771cf7b84..bac3a86dc4 100644 --- a/lib/Parse/Parser.cpp +++ b/lib/Parse/Parser.cpp @@ -665,6 +665,8 @@ Parser::DeclPtrTy Parser::ParseFunctionDefinition(Declarator &D, // ctor-initializer. if (Tok.is(tok::colon)) ParseConstructorInitializer(Res); + else + Actions.ActOnDefaultInitializers(Res); return ParseFunctionStatementBody(Res); }