Commit c222f2aa authored by Roberto Raggi's avatar Roberto Raggi
Browse files

Some cleanup in the AST nodes.

parent a29864ef
......@@ -326,8 +326,8 @@ void Document::check()
return; // nothing to do.
if (TranslationUnitAST *ast = _translationUnit->ast()->asTranslationUnit()) {
for (DeclarationAST *decl = ast->declarations; decl; decl = decl->next) {
semantic.check(decl, globals);
for (DeclarationListAST *decl = ast->declarations; decl; decl = decl->next) {
semantic.check(decl->declaration, globals);
}
} else if (ExpressionAST *ast = _translationUnit->ast()->asExpression()) {
semantic.check(ast, globals);
......
......@@ -356,10 +356,8 @@ unsigned CatchClauseAST::lastToken() const
return statement->lastToken();
else if (rparen_token)
return rparen_token + 1;
for (DeclarationAST *it = exception_declaration; it; it = it->next) {
if (! it->next)
return it->lastToken();
}
if (exception_declaration)
return exception_declaration->lastToken();
if (lparen_token)
return lparen_token + 1;
......@@ -377,7 +375,7 @@ unsigned ClassSpecifierAST::lastToken() const
if (rbrace_token)
return rbrace_token + 1;
for (DeclarationAST *it = member_specifiers; it; it = it->next) {
for (DeclarationListAST *it = member_specifiers; it; it = it->next) {
if (! it->next)
return it->lastToken();
}
......@@ -405,6 +403,21 @@ unsigned ClassSpecifierAST::lastToken() const
}
unsigned StatementListAST::firstToken() const
{
return statement->firstToken();
}
unsigned StatementListAST::lastToken() const
{
for (const StatementListAST *it = this; it; it = it->next) {
if (! it->next)
return it->statement->lastToken();
}
return 0;
}
unsigned CompoundStatementAST::firstToken() const
{
return lbrace_token;
......@@ -415,9 +428,9 @@ unsigned CompoundStatementAST::lastToken() const
if (rbrace_token)
return rbrace_token + 1;
for (StatementAST *it = statements; it ; it = it->next) {
for (StatementListAST *it = statements; it; it = it->next) {
if (! it->next)
return it->lastToken();
return it->statement->lastToken();
}
return lbrace_token + 1;
......@@ -540,6 +553,20 @@ unsigned CtorInitializerAST::lastToken() const
return colon_token + 1;
}
unsigned DeclarationListAST::firstToken() const
{
return declaration->firstToken();
}
unsigned DeclarationListAST::lastToken() const
{
for (const DeclarationListAST *it = this; it; it = it->next) {
if (! it->next)
return it->declaration->lastToken();
}
return 0;
}
unsigned DeclaratorAST::firstToken() const
{
......@@ -986,7 +1013,7 @@ unsigned LinkageBodyAST::lastToken() const
if (rbrace_token)
return rbrace_token + 1;
for (DeclarationAST *it = declarations; it; it = it->next) {
for (DeclarationListAST *it = declarations; it; it = it->next) {
if (! it->next)
return it->lastToken();
}
......@@ -1006,6 +1033,7 @@ unsigned LinkageSpecificationAST::lastToken() const
return declaration->lastToken();
else if (extern_type_token)
return extern_type_token + 1;
return extern_token + 1;
}
......@@ -1553,7 +1581,7 @@ unsigned TemplateDeclarationAST::lastToken() const
else if (greater_token)
return greater_token + 1;
for (DeclarationAST *it = template_parameters; it; it = it->next) {
for (DeclarationListAST *it = template_parameters; it; it = it->next) {
if (! it->next)
return it->lastToken();
}
......@@ -1609,9 +1637,9 @@ unsigned TemplateTypeParameterAST::lastToken() const
else if (greater_token)
return greater_token + 1;
for (DeclarationAST *it = template_parameters; it; it = it->next) {
for (DeclarationListAST *it = template_parameters; it; it = it->next) {
if (! it->next)
return it->lastToken();
return it->declaration->lastToken();
}
if (less_token)
......@@ -1652,7 +1680,7 @@ unsigned TranslationUnitAST::firstToken() const
unsigned TranslationUnitAST::lastToken() const
{
for (DeclarationAST *it = declarations; it; it = it->next) {
for (DeclarationListAST *it = declarations; it; it = it->next) {
if (! it->next)
return it->lastToken();
}
......
......@@ -303,9 +303,6 @@ protected:
class CPLUSPLUS_EXPORT StatementAST: public AST
{
public:
StatementAST *next;
public:
virtual StatementAST *asStatement()
{ return this; }
......@@ -324,9 +321,6 @@ public:
class CPLUSPLUS_EXPORT DeclarationAST: public AST
{
public:
DeclarationAST *next;
public:
virtual DeclarationAST *asDeclaration()
{ return this; }
......@@ -334,6 +328,25 @@ public:
virtual DeclarationAST *clone(MemoryPool *pool) const = 0;
};
class CPLUSPLUS_EXPORT DeclarationListAST: public AST
{
public:
DeclarationAST *declaration;
DeclarationListAST *next;
public:
virtual DeclarationListAST *asDeclarationList()
{ return this; }
virtual unsigned firstToken() const;
virtual unsigned lastToken() const;
virtual DeclarationListAST *clone(MemoryPool *pool) const;
protected:
virtual void accept0(ASTVisitor *visitor);
};
class CPLUSPLUS_EXPORT CoreDeclaratorAST: public AST
{
public:
......@@ -378,7 +391,7 @@ protected:
virtual void accept0(ASTVisitor *visitor);
};
class CPLUSPLUS_EXPORT ExpressionListAST: public ExpressionAST
class CPLUSPLUS_EXPORT ExpressionListAST: public AST
{
public:
unsigned comma_token;
......@@ -601,7 +614,7 @@ public:
unsigned colon_token;
BaseSpecifierAST *base_clause;
unsigned lbrace_token;
DeclarationAST *member_specifiers;
DeclarationListAST *member_specifiers;
unsigned rbrace_token;
public: // annotations
......@@ -641,11 +654,30 @@ protected:
virtual void accept0(ASTVisitor *visitor);
};
class CPLUSPLUS_EXPORT StatementListAST: public AST
{
public:
StatementAST *statement;
StatementListAST *next;
public:
virtual StatementListAST *asStatementList()
{ return this; }
virtual unsigned firstToken() const;
virtual unsigned lastToken() const;
virtual StatementListAST *clone(MemoryPool *pool) const;
protected:
virtual void accept0(ASTVisitor *visitor);
};
class CPLUSPLUS_EXPORT CompoundStatementAST: public StatementAST
{
public:
unsigned lbrace_token;
StatementAST *statements;
StatementListAST *statements;
unsigned rbrace_token;
public: // annotations
......@@ -1201,7 +1233,7 @@ class CPLUSPLUS_EXPORT LinkageBodyAST: public DeclarationAST
{
public:
unsigned lbrace_token;
DeclarationAST *declarations;
DeclarationListAST *declarations;
unsigned rbrace_token;
public:
......@@ -1607,7 +1639,7 @@ protected:
class CPLUSPLUS_EXPORT ParameterDeclarationClauseAST: public AST
{
public:
DeclarationAST *parameter_declarations;
DeclarationListAST *parameter_declarations;
unsigned dot_dot_dot_token;
public:
......@@ -2107,7 +2139,7 @@ public:
unsigned export_token;
unsigned template_token;
unsigned less_token;
DeclarationAST *template_parameters;
DeclarationListAST *template_parameters;
unsigned greater_token;
DeclarationAST *declaration;
......@@ -2146,7 +2178,7 @@ protected:
class CPLUSPLUS_EXPORT TranslationUnitAST: public AST
{
public:
DeclarationAST *declarations;
DeclarationListAST *declarations;
public:
virtual TranslationUnitAST *asTranslationUnit()
......@@ -2255,7 +2287,7 @@ class CPLUSPLUS_EXPORT TemplateTypeParameterAST: public DeclarationAST
public:
unsigned template_token;
unsigned less_token;
DeclarationAST *template_parameters;
DeclarationListAST *template_parameters;
unsigned greater_token;
unsigned class_token;
NameAST *name;
......
......@@ -28,6 +28,7 @@
**************************************************************************/
#include "AST.h"
#include "ASTVisitor.h"
CPLUSPLUS_BEGIN_NAMESPACE
......@@ -83,6 +84,15 @@ TypeofSpecifierAST *TypeofSpecifierAST::clone(MemoryPool *pool) const
return ast;
}
DeclarationListAST *DeclarationListAST::clone(MemoryPool *pool) const
{
DeclarationListAST *ast = new (pool) DeclarationListAST;
// copy DeclarationListAST
if (declaration) ast->declaration = declaration->clone(pool);
if (next) ast->next = next->clone(pool);
return ast;
}
DeclaratorAST *DeclaratorAST::clone(MemoryPool *pool) const
{
DeclaratorAST *ast = new (pool) DeclaratorAST;
......@@ -99,7 +109,6 @@ DeclaratorAST *DeclaratorAST::clone(MemoryPool *pool) const
ExpressionListAST *ExpressionListAST::clone(MemoryPool *pool) const
{
ExpressionListAST *ast = new (pool) ExpressionListAST;
// copy ExpressionAST
// copy ExpressionListAST
ast->comma_token = comma_token;
if (expression) ast->expression = expression->clone(pool);
......@@ -111,7 +120,6 @@ SimpleDeclarationAST *SimpleDeclarationAST::clone(MemoryPool *pool) const
{
SimpleDeclarationAST *ast = new (pool) SimpleDeclarationAST;
// copy DeclarationAST
if (next) ast->next = next->clone(pool);
// copy SimpleDeclarationAST
ast->qt_invokable_token = qt_invokable_token;
if (decl_specifier_seq) ast->decl_specifier_seq = decl_specifier_seq->clone(pool);
......@@ -124,7 +132,6 @@ EmptyDeclarationAST *EmptyDeclarationAST::clone(MemoryPool *pool) const
{
EmptyDeclarationAST *ast = new (pool) EmptyDeclarationAST;
// copy DeclarationAST
if (next) ast->next = next->clone(pool);
// copy EmptyDeclarationAST
ast->semicolon_token = semicolon_token;
return ast;
......@@ -134,7 +141,6 @@ AccessDeclarationAST *AccessDeclarationAST::clone(MemoryPool *pool) const
{
AccessDeclarationAST *ast = new (pool) AccessDeclarationAST;
// copy DeclarationAST
if (next) ast->next = next->clone(pool);
// copy AccessDeclarationAST
ast->access_specifier_token = access_specifier_token;
ast->slots_token = slots_token;
......@@ -146,7 +152,6 @@ AsmDefinitionAST *AsmDefinitionAST::clone(MemoryPool *pool) const
{
AsmDefinitionAST *ast = new (pool) AsmDefinitionAST;
// copy DeclarationAST
if (next) ast->next = next->clone(pool);
// copy AsmDefinitionAST
ast->asm_token = asm_token;
ast->volatile_token = volatile_token;
......@@ -236,7 +241,6 @@ CaseStatementAST *CaseStatementAST::clone(MemoryPool *pool) const
{
CaseStatementAST *ast = new (pool) CaseStatementAST;
// copy StatementAST
if (next) ast->next = next->clone(pool);
// copy CaseStatementAST
ast->case_token = case_token;
if (expression) ast->expression = expression->clone(pool);
......@@ -245,11 +249,19 @@ CaseStatementAST *CaseStatementAST::clone(MemoryPool *pool) const
return ast;
}
StatementListAST *StatementListAST::clone(MemoryPool *pool) const
{
StatementListAST *ast = new (pool) StatementListAST;
// copy StatementListAST
if (statement) ast->statement = statement->clone(pool);
if (next) ast->next = next->clone(pool);
return ast;
}
CompoundStatementAST *CompoundStatementAST::clone(MemoryPool *pool) const
{
CompoundStatementAST *ast = new (pool) CompoundStatementAST;
// copy StatementAST
if (next) ast->next = next->clone(pool);
// copy CompoundStatementAST
ast->lbrace_token = lbrace_token;
if (statements) ast->statements = statements->clone(pool);
......@@ -308,7 +320,6 @@ DeclarationStatementAST *DeclarationStatementAST::clone(MemoryPool *pool) const
{
DeclarationStatementAST *ast = new (pool) DeclarationStatementAST;
// copy StatementAST
if (next) ast->next = next->clone(pool);
// copy DeclarationStatementAST
if (declaration) ast->declaration = declaration->clone(pool);
return ast;
......@@ -388,7 +399,6 @@ DoStatementAST *DoStatementAST::clone(MemoryPool *pool) const
{
DoStatementAST *ast = new (pool) DoStatementAST;
// copy StatementAST
if (next) ast->next = next->clone(pool);
// copy DoStatementAST
ast->do_token = do_token;
if (statement) ast->statement = statement->clone(pool);
......@@ -451,7 +461,6 @@ ExceptionDeclarationAST *ExceptionDeclarationAST::clone(MemoryPool *pool) const
{
ExceptionDeclarationAST *ast = new (pool) ExceptionDeclarationAST;
// copy DeclarationAST
if (next) ast->next = next->clone(pool);
// copy ExceptionDeclarationAST
if (type_specifier) ast->type_specifier = type_specifier->clone(pool);
if (declarator) ast->declarator = declarator->clone(pool);
......@@ -475,7 +484,6 @@ ExpressionOrDeclarationStatementAST *ExpressionOrDeclarationStatementAST::clone(
{
ExpressionOrDeclarationStatementAST *ast = new (pool) ExpressionOrDeclarationStatementAST;
// copy StatementAST
if (next) ast->next = next->clone(pool);
// copy ExpressionOrDeclarationStatementAST
if (expression) ast->expression = expression->clone(pool);
if (declaration) ast->declaration = declaration->clone(pool);
......@@ -486,7 +494,6 @@ ExpressionStatementAST *ExpressionStatementAST::clone(MemoryPool *pool) const
{
ExpressionStatementAST *ast = new (pool) ExpressionStatementAST;
// copy StatementAST
if (next) ast->next = next->clone(pool);
// copy ExpressionStatementAST
if (expression) ast->expression = expression->clone(pool);
ast->semicolon_token = semicolon_token;
......@@ -497,7 +504,6 @@ FunctionDefinitionAST *FunctionDefinitionAST::clone(MemoryPool *pool) const
{
FunctionDefinitionAST *ast = new (pool) FunctionDefinitionAST;
// copy DeclarationAST
if (next) ast->next = next->clone(pool);
// copy FunctionDefinitionAST
ast->qt_invokable_token = qt_invokable_token;
if (decl_specifier_seq) ast->decl_specifier_seq = decl_specifier_seq->clone(pool);
......@@ -511,7 +517,6 @@ ForStatementAST *ForStatementAST::clone(MemoryPool *pool) const
{
ForStatementAST *ast = new (pool) ForStatementAST;
// copy StatementAST
if (next) ast->next = next->clone(pool);
// copy ForStatementAST
ast->for_token = for_token;
ast->lparen_token = lparen_token;
......@@ -528,7 +533,6 @@ IfStatementAST *IfStatementAST::clone(MemoryPool *pool) const
{
IfStatementAST *ast = new (pool) IfStatementAST;
// copy StatementAST
if (next) ast->next = next->clone(pool);
// copy IfStatementAST
ast->if_token = if_token;
ast->lparen_token = lparen_token;
......@@ -555,7 +559,6 @@ LabeledStatementAST *LabeledStatementAST::clone(MemoryPool *pool) const
{
LabeledStatementAST *ast = new (pool) LabeledStatementAST;
// copy StatementAST
if (next) ast->next = next->clone(pool);
// copy LabeledStatementAST
ast->label_token = label_token;
ast->colon_token = colon_token;
......@@ -567,7 +570,6 @@ LinkageBodyAST *LinkageBodyAST::clone(MemoryPool *pool) const
{
LinkageBodyAST *ast = new (pool) LinkageBodyAST;
// copy DeclarationAST
if (next) ast->next = next->clone(pool);
// copy LinkageBodyAST
ast->lbrace_token = lbrace_token;
if (declarations) ast->declarations = declarations->clone(pool);
......@@ -579,7 +581,6 @@ LinkageSpecificationAST *LinkageSpecificationAST::clone(MemoryPool *pool) const
{
LinkageSpecificationAST *ast = new (pool) LinkageSpecificationAST;
// copy DeclarationAST
if (next) ast->next = next->clone(pool);
// copy LinkageSpecificationAST
ast->extern_token = extern_token;
ast->extern_type_token = extern_type_token;
......@@ -683,7 +684,6 @@ NamespaceAST *NamespaceAST::clone(MemoryPool *pool) const
{
NamespaceAST *ast = new (pool) NamespaceAST;
// copy DeclarationAST
if (next) ast->next = next->clone(pool);
// copy NamespaceAST
ast->namespace_token = namespace_token;
ast->identifier_token = identifier_token;
......@@ -696,7 +696,6 @@ NamespaceAliasDefinitionAST *NamespaceAliasDefinitionAST::clone(MemoryPool *pool
{
NamespaceAliasDefinitionAST *ast = new (pool) NamespaceAliasDefinitionAST;
// copy DeclarationAST
if (next) ast->next = next->clone(pool);
// copy NamespaceAliasDefinitionAST
ast->namespace_token = namespace_token;
ast->namespace_name_token = namespace_name_token;
......@@ -777,7 +776,6 @@ ParameterDeclarationAST *ParameterDeclarationAST::clone(MemoryPool *pool) const
{
ParameterDeclarationAST *ast = new (pool) ParameterDeclarationAST;
// copy DeclarationAST
if (next) ast->next = next->clone(pool);
// copy ParameterDeclarationAST
if (type_specifier) ast->type_specifier = type_specifier->clone(pool);
if (declarator) ast->declarator = declarator->clone(pool);
......@@ -926,7 +924,6 @@ BreakStatementAST *BreakStatementAST::clone(MemoryPool *pool) const
{
BreakStatementAST *ast = new (pool) BreakStatementAST;
// copy StatementAST
if (next) ast->next = next->clone(pool);
// copy BreakStatementAST
ast->break_token = break_token;
ast->semicolon_token = semicolon_token;
......@@ -937,7 +934,6 @@ ContinueStatementAST *ContinueStatementAST::clone(MemoryPool *pool) const
{
ContinueStatementAST *ast = new (pool) ContinueStatementAST;
// copy StatementAST
if (next) ast->next = next->clone(pool);
// copy ContinueStatementAST
ast->continue_token = continue_token;
ast->semicolon_token = semicolon_token;
......@@ -948,7 +944,6 @@ GotoStatementAST *GotoStatementAST::clone(MemoryPool *pool) const
{
GotoStatementAST *ast = new (pool) GotoStatementAST;
// copy StatementAST
if (next) ast->next = next->clone(pool);
// copy GotoStatementAST
ast->goto_token = goto_token;
ast->identifier_token = identifier_token;
......@@ -960,7 +955,6 @@ ReturnStatementAST *ReturnStatementAST::clone(MemoryPool *pool) const
{
ReturnStatementAST *ast = new (pool) ReturnStatementAST;
// copy StatementAST
if (next) ast->next = next->clone(pool);
// copy ReturnStatementAST
ast->return_token = return_token;
if (expression) ast->expression = expression->clone(pool);
......@@ -1030,7 +1024,6 @@ SwitchStatementAST *SwitchStatementAST::clone(MemoryPool *pool) const
{
SwitchStatementAST *ast = new (pool) SwitchStatementAST;
// copy StatementAST
if (next) ast->next = next->clone(pool);
// copy SwitchStatementAST
ast->switch_token = switch_token;
ast->lparen_token = lparen_token;
......@@ -1054,7 +1047,6 @@ TemplateDeclarationAST *TemplateDeclarationAST::clone(MemoryPool *pool) const
{
TemplateDeclarationAST *ast = new (pool) TemplateDeclarationAST;
// copy DeclarationAST
if (next) ast->next = next->clone(pool);
// copy TemplateDeclarationAST
ast->export_token = export_token;
ast->template_token = template_token;
......@@ -1087,7 +1079,6 @@ TryBlockStatementAST *TryBlockStatementAST::clone(MemoryPool *pool) const
{
TryBlockStatementAST *ast = new (pool) TryBlockStatementAST;
// copy StatementAST
if (next) ast->next = next->clone(pool);
// copy TryBlockStatementAST
ast->try_token = try_token;
if (statement) ast->statement = statement->clone(pool);
......@@ -1099,7 +1090,6 @@ CatchClauseAST *CatchClauseAST::clone(MemoryPool *pool) const
{
CatchClauseAST *ast = new (pool) CatchClauseAST;
// copy StatementAST
if (next) ast->next = next->clone(pool);
// copy CatchClauseAST
ast->catch_token = catch_token;
ast->lparen_token = lparen_token;
......@@ -1124,7 +1114,6 @@ TypenameTypeParameterAST *TypenameTypeParameterAST::clone(MemoryPool *pool) cons
{
TypenameTypeParameterAST *ast = new (pool) TypenameTypeParameterAST;
// copy DeclarationAST
if (next) ast->next = next->clone(pool);
// copy TypenameTypeParameterAST
ast->classkey_token = classkey_token;
if (name) ast->name = name->clone(pool);
......@@ -1137,7 +1126,6 @@ TemplateTypeParameterAST *TemplateTypeParameterAST::clone(MemoryPool *pool) cons
{
TemplateTypeParameterAST *ast = new (pool) TemplateTypeParameterAST;
// copy DeclarationAST
if (next) ast->next = next->clone(pool);
// copy TemplateTypeParameterAST
ast->template_token = template_token;
ast->less_token = less_token;
......@@ -1164,7 +1152,6 @@ UsingAST *UsingAST::clone(MemoryPool *pool) const
{
UsingAST *ast = new (pool) UsingAST;
// copy DeclarationAST
if (next) ast->next = next->clone(pool);
// copy UsingAST
ast->using_token = using_token;
ast->typename_token = typename_token;
......@@ -1177,7 +1164,6 @@ UsingDirectiveAST *UsingDirectiveAST::clone(MemoryPool *pool) const
{
UsingDirectiveAST *ast = new (pool) UsingDirectiveAST;
// copy DeclarationAST
if (next) ast->next = next->clone(pool);
// copy UsingDirectiveAST
ast->using_token = using_token;
ast->namespace_token = namespace_token;
......@@ -1190,7 +1176,6 @@ WhileStatementAST *WhileStatementAST::clone(MemoryPool *pool) const
{
WhileStatementAST *ast = new (pool) WhileStatementAST;
// copy StatementAST
if (next) ast->next = next->clone(pool);
// copy WhileStatementAST
ast->while_token = while_token;
ast->lparen_token = lparen_token;
......@@ -1213,7 +1198,6 @@ ObjCClassDeclarationAST *ObjCClassDeclarationAST::clone(MemoryPool *pool) const
{
ObjCClassDeclarationAST *ast = new (pool) ObjCClassDeclarationAST;
// copy DeclarationAST
if (next) ast->next = next->clone(pool);
// copy ObjCClassDeclarationAST
if (attributes) ast->attributes = attributes->clone(pool);
ast->class_token = class_token;
......
This diff is collapsed.
......@@ -171,6 +171,7 @@ public:
virtual bool visit(SimpleNameAST *) { return true; }
virtual bool visit(SimpleSpecifierAST *) { return true; }
virtual bool visit(SizeofExpressionAST *) { return true; }
virtual bool visit(StatementListAST *) { return true; }
virtual bool visit(StringLiteralAST *) { return true; }
virtual bool visit(SwitchStatementAST *) { return true; }
virtual bool visit(TemplateArgumentListAST *) { return true; }
......@@ -197,6 +198,8 @@ public:
virtual bool visit(IdentifierListAST *) { return true; }
virtual bool visit(ObjCClassDeclarationAST *) { return true; }
virtual bool visit(DeclarationListAST *) { return true; }
virtual void endVisit(DeclarationListAST *) { }
virtual void endVisit(AccessDeclarationAST *) { }
......@@ -276,6 +279,7 @@ public:
virtual void endVisit(SimpleNameAST *) { }
virtual void endVisit(SimpleSpecifierAST *) { }
virtual void endVisit(SizeofExpressionAST *) { }
virtual void endVisit(StatementListAST *) { }
virtual void endVisit(StringLiteralAST *) { }
virtual void endVisit(SwitchStatementAST *) { }
virtual void endVisit(TemplateArgumentListAST *) { }
......
......@@ -83,6 +83,7 @@ class CoreDeclaratorAST;
class CppCastExpressionAST;
class CtorInitializerAST;
class DeclarationAST;
class DeclarationListAST;
class DeclarationStatementAST;
class DeclaratorAST;
class DeclaratorIdAST;
......@@ -143,6 +144,7 @@ class SimpleSpecifierAST;
class SizeofExpressionAST;
class SpecifierAST;
class StatementAST;
class StatementListAST;
class StringLiteralAST;
class SwitchStatementAST;
class TemplateArgumentListAST;
......
......@@ -311,27 +311,20 @@ bool CheckDeclaration::visit(FunctionDefinitionAST *ast)
semantic()->switchMethodKey(previousMethodKey);
semantic()->switchVisibility(previousVisibility);
if (ast->next && ast->next->asEmptyDeclaration()) {