Skip to content

Commit 30eb1aa

Browse files
committed
Allow alias declarations in init statements
Fixes #588 Signed-off-by: Roberto Raggi <[email protected]>
1 parent eed8b7d commit 30eb1aa

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/parser/cxx/parser.cc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3246,8 +3246,10 @@ void Parser::parse_init_statement(StatementAST*& yyast) {
32463246
cxx_runtime_error("enclosing scope of init statement is not empty");
32473247
}
32483248

3249-
if (!parse_simple_declaration(declaration,
3250-
BindingContext::kInitStatement)) {
3249+
if (parse_alias_declaration(declaration)) {
3250+
// did parse an alias declaration
3251+
} else if (!parse_simple_declaration(declaration,
3252+
BindingContext::kInitStatement)) {
32513253
scope()->reset();
32523254
return false;
32533255
}

0 commit comments

Comments
 (0)