diff options
author | Erik Verbruggen <erik.verbruggen@nokia.com> | 2009-07-31 13:22:32 +0200 |
---|---|---|
committer | Erik Verbruggen <erik.verbruggen@nokia.com> | 2009-07-31 13:22:32 +0200 |
commit | b713f1772a4de8330bcdd96a00b9cf103541e008 (patch) | |
tree | dbf903d169e12e983d1cc9355723ea1737d0b270 /src/shared/cplusplus/CheckDeclarator.cpp | |
parent | b54517ad0fab5cfd1500975c52641d0afca6748d (diff) | |
download | qt-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.cpp | 21 |
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) |