Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Tobias Hunger
qt-creator
Commits
3c3af9c2
Commit
3c3af9c2
authored
Jun 18, 2010
by
Erik Verbruggen
Browse files
Fixed return-type checking for ObjC methods.
parent
a1a565b9
Changes
7
Hide whitespace changes
Inline
Side-by-side
src/shared/cplusplus/CheckDeclaration.cpp
View file @
3c3af9c2
...
...
@@ -720,10 +720,6 @@ bool CheckDeclaration::visit(ObjCMethodDeclarationAST *ast)
Symbol
*
symbol
;
if
(
ast
->
function_body
)
{
if
(
!
semantic
()
->
skipFunctionBodies
())
{
semantic
()
->
check
(
ast
->
function_body
,
methodTy
->
members
());
}
symbol
=
methodTy
;
}
else
{
Declaration
*
decl
=
control
()
->
newDeclaration
(
selector
->
firstToken
(),
methodTy
->
name
());
...
...
@@ -742,6 +738,10 @@ bool CheckDeclaration::visit(ObjCMethodDeclarationAST *ast)
_scope
->
enterSymbol
(
symbol
);
if
(
ast
->
function_body
&&
!
semantic
()
->
skipFunctionBodies
())
{
semantic
()
->
check
(
ast
->
function_body
,
methodTy
->
members
());
}
return
false
;
}
...
...
src/shared/cplusplus/CheckDeclarator.cpp
View file @
3c3af9c2
...
...
@@ -260,7 +260,9 @@ bool CheckDeclarator::visit(ObjCMethodPrototypeAST *ast)
return
false
;
}
FullySpecifiedType
returnType
=
semantic
()
->
check
(
ast
->
type_name
,
_scope
);
FullySpecifiedType
returnType
;
if
(
ast
->
type_name
&&
ast
->
type_name
->
type_id
)
returnType
=
semantic
()
->
check
(
ast
->
type_name
->
type_id
,
_scope
);
unsigned
location
=
ast
->
selector
->
firstToken
();
...
...
src/shared/cplusplus/CheckName.cpp
View file @
3c3af9c2
...
...
@@ -394,8 +394,8 @@ bool CheckName::visit(ObjCMessageArgumentDeclarationAST *ast)
{
FullySpecifiedType
type
;
if
(
ast
->
type_name
)
type
=
semantic
()
->
check
(
ast
->
type_name
,
_scope
);
if
(
ast
->
type_name
&&
ast
->
type_name
->
type_id
)
type
=
semantic
()
->
check
(
ast
->
type_name
->
type_id
,
_scope
);
if
(
ast
->
param_name
)
{
accept
(
ast
->
param_name
);
...
...
src/shared/cplusplus/CheckSpecifier.cpp
View file @
3c3af9c2
...
...
@@ -82,19 +82,6 @@ FullySpecifiedType CheckSpecifier::check(SpecifierListAST *specifier,
return
switchFullySpecifiedType
(
previousType
);
}
FullySpecifiedType
CheckSpecifier
::
check
(
ObjCTypeNameAST
*
typeName
,
Scope
*
scope
,
const
FullySpecifiedType
&
ty
)
{
FullySpecifiedType
previousType
=
switchFullySpecifiedType
(
ty
);
Scope
*
previousScope
=
switchScope
(
scope
);
accept
(
typeName
);
(
void
)
switchScope
(
previousScope
);
return
switchFullySpecifiedType
(
previousType
);
}
SpecifierListAST
*
CheckSpecifier
::
switchSpecifier
(
SpecifierListAST
*
specifier
)
{
SpecifierListAST
*
previousSpecifier
=
_specifier
;
...
...
src/shared/cplusplus/CheckSpecifier.h
View file @
3c3af9c2
...
...
@@ -64,8 +64,6 @@ public:
FullySpecifiedType
check
(
SpecifierListAST
*
specifier
,
Scope
*
scope
,
const
FullySpecifiedType
&
ty
=
FullySpecifiedType
());
FullySpecifiedType
check
(
ObjCTypeNameAST
*
typeName
,
Scope
*
scope
,
const
FullySpecifiedType
&
ty
=
FullySpecifiedType
());
protected:
SpecifierListAST
*
switchSpecifier
(
SpecifierListAST
*
specifier
);
...
...
src/shared/cplusplus/Semantic.cpp
View file @
3c3af9c2
...
...
@@ -169,10 +169,6 @@ FullySpecifiedType Semantic::check(PtrOperatorListAST *ptrOperators, const Fully
FullySpecifiedType
Semantic
::
check
(
ObjCMethodPrototypeAST
*
methodPrototype
,
Scope
*
scope
)
{
return
d
->
checkDeclarator
->
check
(
methodPrototype
,
scope
);
}
FullySpecifiedType
Semantic
::
check
(
ObjCTypeNameAST
*
typeName
,
Scope
*
scope
,
const
FullySpecifiedType
&
type
)
{
return
d
->
checkSpecifier
->
check
(
typeName
,
scope
,
type
);
}
void
Semantic
::
check
(
ObjCMessageArgumentDeclarationAST
*
arg
,
Scope
*
scope
)
{
return
d
->
checkName
->
check
(
arg
,
scope
);
}
...
...
src/shared/cplusplus/Semantic.h
View file @
3c3af9c2
...
...
@@ -107,9 +107,6 @@ public:
const
Name
*
check
(
NestedNameSpecifierListAST
*
name
,
Scope
*
scope
);
FullySpecifiedType
check
(
ObjCTypeNameAST
*
typeName
,
Scope
*
scope
,
const
FullySpecifiedType
&
type
=
FullySpecifiedType
());
void
check
(
ObjCMessageArgumentDeclarationAST
*
arg
,
Scope
*
scope
);
void
checkFunctionDefinition
(
FunctionDefinitionAST
*
ast
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment