summaryrefslogtreecommitdiff
path: root/src/shared/cplusplus
diff options
context:
space:
mode:
Diffstat (limited to 'src/shared/cplusplus')
-rw-r--r--src/shared/cplusplus/CheckDeclaration.cpp14
-rw-r--r--src/shared/cplusplus/CheckDeclarator.cpp3
-rw-r--r--src/shared/cplusplus/CheckName.cpp2
3 files changed, 10 insertions, 9 deletions
diff --git a/src/shared/cplusplus/CheckDeclaration.cpp b/src/shared/cplusplus/CheckDeclaration.cpp
index 719a0c82eb..9758f306a2 100644
--- a/src/shared/cplusplus/CheckDeclaration.cpp
+++ b/src/shared/cplusplus/CheckDeclaration.cpp
@@ -666,22 +666,22 @@ bool CheckDeclaration::visit(ObjCMethodDeclarationAST *ast)
return false;
FullySpecifiedType ty = semantic()->check(ast->method_prototype, _scope);
- ObjCMethod *methodType = ty.type()->asObjCMethodType();
- if (!methodType)
+ ObjCMethod *methodTy = ty.type()->asObjCMethodType();
+ if (!methodTy)
return false;
Symbol *symbol;
if (ast->function_body) {
if (!semantic()->skipFunctionBodies()) {
- semantic()->check(ast->function_body, methodType->members());
+ semantic()->check(ast->function_body, methodTy->members());
}
- symbol = methodType;
+ symbol = methodTy;
} else {
- Declaration *decl = control()->newDeclaration(ast->firstToken(), methodType->name());
- decl->setType(methodType);
+ Declaration *decl = control()->newDeclaration(ast->firstToken(), methodTy->name());
+ decl->setType(methodTy);
symbol = decl;
- symbol->setStorage(methodType->storage());
+ symbol->setStorage(methodTy->storage());
}
symbol->setStartOffset(tokenAt(ast->firstToken()).offset);
diff --git a/src/shared/cplusplus/CheckDeclarator.cpp b/src/shared/cplusplus/CheckDeclarator.cpp
index 7af4e02268..d87b099790 100644
--- a/src/shared/cplusplus/CheckDeclarator.cpp
+++ b/src/shared/cplusplus/CheckDeclarator.cpp
@@ -97,10 +97,11 @@ FullySpecifiedType CheckDeclarator::check(PtrOperatorListAST *ptrOperators,
FullySpecifiedType CheckDeclarator::check(ObjCMethodPrototypeAST *methodPrototype,
Scope *scope)
{
+ FullySpecifiedType previousType = switchFullySpecifiedType(FullySpecifiedType());
Scope *previousScope = switchScope(scope);
accept(methodPrototype);
(void) switchScope(previousScope);
- return _fullySpecifiedType;
+ return switchFullySpecifiedType(previousType);
}
DeclaratorAST *CheckDeclarator::switchDeclarator(DeclaratorAST *declarator)
diff --git a/src/shared/cplusplus/CheckName.cpp b/src/shared/cplusplus/CheckName.cpp
index 8f275515df..26fa9c21ee 100644
--- a/src/shared/cplusplus/CheckName.cpp
+++ b/src/shared/cplusplus/CheckName.cpp
@@ -423,7 +423,7 @@ bool CheckName::visit(ObjCMessageArgumentDeclarationAST *ast)
_name = control()->nameId(id);
ast->name = _name;
- Argument *arg = control()->newArgument(ast->firstToken(), _name);
+ Argument *arg = control()->newArgument(ast->param_name_token, _name);
ast->argument = arg;
arg->setType(type);
arg->setInitializer(0);