diff options
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) |