aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/parse.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/parse.c')
-rw-r--r--src/parse.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/parse.c b/src/parse.c
index 39bd8f2..819c418 100644
--- a/src/parse.c
+++ b/src/parse.c
@@ -1433,8 +1433,12 @@ static AstNode* parse_func_def(Parser* p, AstNode* decls) {
}
Type* ty = decls->node_items[0].ty;
- ty->storage_class = ty->result->storage_class;
- ty->result->storage_class = StorageClass_unspecified;
+ Type* base_ty = ty->result;
+ while (base_ty->base) {
+ base_ty = base_ty->base;
+ }
+ ty->storage_class = base_ty->storage_class;
+ base_ty->storage_class = StorageClass_unspecified;
const char* name = decls->node_items[0].name;
AstNode* params = ty->params;