diff options
author | Sebastian Redl <sebastian.redl@getdesigned.at> | 2011-09-24 17:48:25 +0000 |
---|---|---|
committer | Sebastian Redl <sebastian.redl@getdesigned.at> | 2011-09-24 17:48:25 +0000 |
commit | 6df6548e44a61c444bd85dccd0398cba047c79b1 (patch) | |
tree | 2758dd4121d78176521748827c41dd10fa78b9f4 /lib/Parse/ParseDeclCXX.cpp | |
parent | cea8d966f826554f0679595e9371e314e8dbc1cf (diff) |
Correctly parse braced member initializers (even in delayed parsing) and correctly pass
the information on to Sema. There's still an incorrectness in the way template instantiation
works now, but that is due to a far larger underlying representational problem.
Also add a test case for various list initialization cases of scalars, which test this
commit as well as the previous one.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140460 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseDeclCXX.cpp')
-rw-r--r-- | lib/Parse/ParseDeclCXX.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/lib/Parse/ParseDeclCXX.cpp b/lib/Parse/ParseDeclCXX.cpp index 0fcc863b12..21cf3a1e1c 100644 --- a/lib/Parse/ParseDeclCXX.cpp +++ b/lib/Parse/ParseDeclCXX.cpp @@ -2292,9 +2292,17 @@ Parser::MemInitResult Parser::ParseMemInitializer(Decl *ConstructorDecl) { // Parse the '('. if (getLang().CPlusPlus0x && Tok.is(tok::l_brace)) { - // FIXME: Do something with the braced-init-list. - ParseBraceInitializer(); - return true; + ExprResult InitList = ParseBraceInitializer(); + if (InitList.isInvalid()) + return true; + + SourceLocation EllipsisLoc; + if (Tok.is(tok::ellipsis)) + EllipsisLoc = ConsumeToken(); + + return Actions.ActOnMemInitializer(ConstructorDecl, getCurScope(), SS, II, + TemplateTypeTy, IdLoc, InitList.take(), + EllipsisLoc); } else if(Tok.is(tok::l_paren)) { SourceLocation LParenLoc = ConsumeParen(); |