summaryrefslogtreecommitdiff
path: root/src/shared/cplusplus/CheckDeclarator.cpp
diff options
context:
space:
mode:
authorErik Verbruggen <erik.verbruggen@nokia.com>2009-07-31 13:22:32 +0200
committerErik Verbruggen <erik.verbruggen@nokia.com>2009-07-31 13:22:32 +0200
commitb713f1772a4de8330bcdd96a00b9cf103541e008 (patch)
treedbf903d169e12e983d1cc9355723ea1737d0b270 /src/shared/cplusplus/CheckDeclarator.cpp
parentb54517ad0fab5cfd1500975c52641d0afca6748d (diff)
downloadqt-creator-b713f1772a4de8330bcdd96a00b9cf103541e008.tar.gz
Added semantic checks for method declarations.
Diffstat (limited to 'src/shared/cplusplus/CheckDeclarator.cpp')
-rw-r--r--src/shared/cplusplus/CheckDeclarator.cpp21
1 files changed, 14 insertions, 7 deletions
diff --git a/src/shared/cplusplus/CheckDeclarator.cpp b/src/shared/cplusplus/CheckDeclarator.cpp
index 27a0a03fc3..6ff3b923a3 100644
--- a/src/shared/cplusplus/CheckDeclarator.cpp
+++ b/src/shared/cplusplus/CheckDeclarator.cpp
@@ -248,6 +248,8 @@ bool CheckDeclarator::visit(ReferenceAST *ast)
bool CheckDeclarator::visit(ObjCMethodPrototypeAST *ast)
{
+ FullySpecifiedType returnType = semantic()->check(ast->type_name, _scope);
+
unsigned location = ast->firstToken();
Name *name = semantic()->check(ast->selector, _scope);
@@ -259,15 +261,20 @@ bool CheckDeclarator::visit(ObjCMethodPrototypeAST *ast)
fun->setMethodKey(Function::NormalMethod);
fun->setVisibility(semantic()->currentVisibility());
fun->setPureVirtual(false);
+ fun->setReturnType(returnType);
+
+ if (ast->selector->asObjCSelectorWithArguments()) {
+ // TODO: check the parameters (EV)
+ // fun->setVariadic(...);
+ // TODO: add arguments (EV)
+ for (ObjCMessageArgumentDeclarationListAST *it = ast->arguments; it; it = it->next) {
+ ObjCMessageArgumentDeclarationAST *argDecl = it->argument_declaration;
- // TODO: check return type (EV)
-// fun->setReturnType(semantic()->check(ast->type_name, _scope));
- // TODO: check the parameters (EV)
- // fun->setVariadic(...);
- // TODO: add arguments (EV)
+ semantic()->check(argDecl, fun->arguments());
+ }
+ }
- FullySpecifiedType mTy(fun);
- _fullySpecifiedType = mTy;
+ _fullySpecifiedType = FullySpecifiedType(fun);
// TODO: check which specifiers are allowed here (EV)