summaryrefslogtreecommitdiff
path: root/src/shared/cplusplus/CheckDeclaration.cpp
diff options
context:
space:
mode:
authorRoberto Raggi <roberto.raggi@nokia.com>2009-06-17 16:08:01 +0200
committerRoberto Raggi <roberto.raggi@nokia.com>2009-06-17 16:08:33 +0200
commitc222f2aa27a5d3cbc4583d2ae8ee60d623aaacc4 (patch)
treecadc4126fe8e2c5b89a996024dc9ce716652a626 /src/shared/cplusplus/CheckDeclaration.cpp
parenta29864ef012d98ad6773ba4690704b731c79c7da (diff)
downloadqt-creator-c222f2aa27a5d3cbc4583d2ae8ee60d623aaacc4.tar.gz
Some cleanup in the AST nodes.
Diffstat (limited to 'src/shared/cplusplus/CheckDeclaration.cpp')
-rw-r--r--src/shared/cplusplus/CheckDeclaration.cpp23
1 files changed, 5 insertions, 18 deletions
diff --git a/src/shared/cplusplus/CheckDeclaration.cpp b/src/shared/cplusplus/CheckDeclaration.cpp
index 42004bcc8e..79392bf4e7 100644
--- a/src/shared/cplusplus/CheckDeclaration.cpp
+++ b/src/shared/cplusplus/CheckDeclaration.cpp
@@ -311,27 +311,20 @@ bool CheckDeclaration::visit(FunctionDefinitionAST *ast)
semantic()->switchMethodKey(previousMethodKey);
semantic()->switchVisibility(previousVisibility);
- if (ast->next && ast->next->asEmptyDeclaration()) {
- translationUnit()->warning(ast->next->firstToken(),
- "unnecessary semicolon after function block");
- }
-
return false;
}
bool CheckDeclaration::visit(LinkageBodyAST *ast)
{
- for (DeclarationAST *decl = ast->declarations; decl; decl = decl->next) {
- semantic()->check(decl, _scope);
+ for (DeclarationListAST *decl = ast->declarations; decl; decl = decl->next) {
+ semantic()->check(decl->declaration, _scope);
}
return false;
}
bool CheckDeclaration::visit(LinkageSpecificationAST *ast)
{
- for (DeclarationAST *decl = ast->declaration; decl; decl = decl->next) {
- semantic()->check(decl, _scope);
- }
+ semantic()->check(ast->declaration, _scope);
return false;
}
@@ -352,11 +345,6 @@ bool CheckDeclaration::visit(NamespaceAST *ast)
_scope->enterSymbol(ns);
semantic()->check(ast->linkage_body, ns->members()); // ### we'll do the merge later.
- if (ast->next && ast->next->asEmptyDeclaration()) {
- translationUnit()->warning(ast->next->firstToken(),
- "unnecessary semicolon after namespace");
- }
-
return false;
}
@@ -389,9 +377,8 @@ bool CheckDeclaration::visit(ParameterDeclarationAST *ast)
bool CheckDeclaration::visit(TemplateDeclarationAST *ast)
{
Scope *previousScope = switchScope(new Scope(_scope->owner()));
- for (DeclarationAST *param = ast->template_parameters; param;
- param = param->next) {
- semantic()->check(param, _scope);
+ for (DeclarationListAST *param = ast->template_parameters; param; param = param->next) {
+ semantic()->check(param->declaration, _scope);
}
Scope *templateParameters = switchScope(previousScope);