C++11: Make 'enum struct', enum-base and opaque enum decls work.

For declarations like:
enum struct Foo : long int;

Change-Id: Id813efdbc31c8d70a4b40bb0101dc33a8dd2556a
Reviewed-by: hjk <qthjk@ovi.com>
This commit is contained in:
Christian Kamm
2012-09-18 11:17:29 +02:00
committed by hjk
parent 8711121197
commit 44c9cef30a
10 changed files with 75 additions and 13 deletions

View File

@@ -558,8 +558,13 @@ EnumSpecifierAST *EnumSpecifierAST::clone(MemoryPool *pool) const
{
EnumSpecifierAST *ast = new (pool) EnumSpecifierAST;
ast->enum_token = enum_token;
ast->key_token = key_token;
if (name)
ast->name = name->clone(pool);
ast->colon_token = colon_token;
for (SpecifierListAST *iter = type_specifier_list, **ast_iter = &ast->type_specifier_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : 0);
ast->lbrace_token = lbrace_token;
for (EnumeratorListAST *iter = enumerator_list, **ast_iter = &ast->enumerator_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)