|
@@ -928,12 +928,21 @@ type_like_declaration:
|
|
|
|
|
|
|
|
current_scope->add_declaration($2, global_scope, current_lexer, @2);
|
|
current_scope->add_declaration($2, global_scope, current_lexer, @2);
|
|
|
}
|
|
}
|
|
|
- | storage_class constructor_prototype maybe_initialize_or_constructor_body
|
|
|
|
|
|
|
+ | storage_class constructor_prototype
|
|
|
{
|
|
{
|
|
|
if ($2 != (CPPInstance *)NULL) {
|
|
if ($2 != (CPPInstance *)NULL) {
|
|
|
|
|
+ // Push the scope so that the initializers can make use of things defined
|
|
|
|
|
+ // in the class body.
|
|
|
|
|
+ push_scope($2->get_scope(current_scope, global_scope));
|
|
|
$2->_storage_class |= (current_storage_class | $1);
|
|
$2->_storage_class |= (current_storage_class | $1);
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+ maybe_initialize_or_constructor_body
|
|
|
|
|
+{
|
|
|
|
|
+ if ($2 != (CPPInstance *)NULL) {
|
|
|
|
|
+ pop_scope();
|
|
|
current_scope->add_declaration($2, global_scope, current_lexer, @2);
|
|
current_scope->add_declaration($2, global_scope, current_lexer, @2);
|
|
|
- $2->set_initializer($3);
|
|
|
|
|
|
|
+ $2->set_initializer($4);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
| storage_class function_prototype maybe_initialize_or_function_body
|
|
| storage_class function_prototype maybe_initialize_or_function_body
|