summaryrefslogtreecommitdiff
path: root/src/shared/cplusplus
diff options
context:
space:
mode:
authorRoberto Raggi <roberto.raggi@nokia.com>2010-08-13 18:24:26 +0200
committerRoberto Raggi <roberto.raggi@nokia.com>2010-08-13 18:24:38 +0200
commit04e7c491ebc4d2dd35b2e702e42f8dfbc2ee40e3 (patch)
treeacbe1503537548ed1573e5d30f77e2f22521b210 /src/shared/cplusplus
parent9061a8289f31d96e5b418c1340a93cd7f7f5279d (diff)
downloadqt-creator-04e7c491ebc4d2dd35b2e702e42f8dfbc2ee40e3.tar.gz
Propagate the decl specifiers.
Diffstat (limited to 'src/shared/cplusplus')
-rw-r--r--src/shared/cplusplus/Bind.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/shared/cplusplus/Bind.cpp b/src/shared/cplusplus/Bind.cpp
index 54688596af..777d0f8444 100644
--- a/src/shared/cplusplus/Bind.cpp
+++ b/src/shared/cplusplus/Bind.cpp
@@ -110,8 +110,9 @@ void Bind::setDeclSpecifiers(Symbol *symbol, const FullySpecifiedType &declSpeci
symbol->setStorage(storage);
if (Function *funTy = symbol->asFunction()) {
- if (declSpecifiers.isVirtual())
+ if (declSpecifiers.isVirtual()) {
funTy->setVirtual(true);
+ }
}
if (declSpecifiers.isDeprecated())
@@ -1723,6 +1724,7 @@ bool Bind::visit(SimpleDeclarationAST *ast)
setDeclSpecifiers(decl, type);
if (Function *fun = decl->type()->asFunctionType()) {
+ setDeclSpecifiers(fun, type);
if (declaratorId && declaratorId->name)
fun->setName(declaratorId->name->name); // update the function name
}
@@ -1862,18 +1864,18 @@ bool Bind::visit(ExceptionDeclarationAST *ast)
bool Bind::visit(FunctionDefinitionAST *ast)
{
// unsigned qt_invokable_token = ast->qt_invokable_token;
- FullySpecifiedType type;
+ FullySpecifiedType declSpecifiers;
for (SpecifierListAST *it = ast->decl_specifier_list; it; it = it->next) {
- type = this->specifier(it->value, type);
+ declSpecifiers = this->specifier(it->value, declSpecifiers);
}
DeclaratorIdAST *declaratorId = 0;
- type = this->declarator(ast->declarator, type, &declaratorId);
+ FullySpecifiedType type = this->declarator(ast->declarator, declSpecifiers.qualifiedType(), &declaratorId);
Function *fun = type->asFunctionType();
ast->symbol = fun;
if (fun) {
- setDeclSpecifiers(fun, type);
+ setDeclSpecifiers(fun, declSpecifiers);
if (_scope->isClass()) {
fun->setVisibility(_visibility);