C++11: Allow uniform initialization in ctor init lists.

So
class C { C() : _x{12}, _y({12}) {} };
now parses correctly.

Change-Id: I4281dcb0541a86b550e74630cad6ae0a59fef1b4
Reviewed-by: hjk <qthjk@ovi.com>
This commit is contained in:
Christian Kamm
2012-09-17 09:58:09 +02:00
committed by hjk
parent 903ba378c2
commit b9f6f1bcf7
16 changed files with 88 additions and 71 deletions

View File

@@ -517,9 +517,7 @@ void Bind::memInitializer(MemInitializerAST *ast, Function *fun)
/*const Name *name =*/ this->name(ast->name);
Scope *previousScope = switchScope(fun);
for (ExpressionListAST *it = ast->expression_list; it; it = it->next) {
/*ExpressionTy value =*/ this->expression(it->value);
}
this->expression(ast->expression);
(void) switchScope(previousScope);
}
@@ -541,8 +539,12 @@ const Name *Bind::nestedNameSpecifier(NestedNameSpecifierAST *ast)
bool Bind::visit(ExpressionListParenAST *ast)
{
(void) ast;
assert(!"unreachable");
// unsigned lparen_token = ast->lparen_token;
for (ExpressionListAST *it = ast->expression_list; it; it = it->next) {
/*ExpressionTy value =*/ this->expression(it->value);
}
// unsigned rparen_token = ast->rparen_token;
return false;
}
@@ -1804,7 +1806,7 @@ bool Bind::visit(BracedInitializerAST *ast)
{
// unsigned lbrace_token = ast->lbrace_token;
for (ExpressionListAST *it = ast->expression_list; it; it = it->next) {
ExpressionTy value = this->expression(it->value);
/*ExpressionTy value =*/ this->expression(it->value);
}
// unsigned comma_token = ast->comma_token;
// unsigned rbrace_token = ast->rbrace_token;