aboutsummaryrefslogtreecommitdiff
path: root/src/check_decl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/check_decl.cpp')
-rw-r--r--src/check_decl.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/check_decl.cpp b/src/check_decl.cpp
index f59d072b7..0e669e473 100644
--- a/src/check_decl.cpp
+++ b/src/check_decl.cpp
@@ -675,6 +675,16 @@ void check_proc_decl(CheckerContext *ctx, Entity *e, DeclInfo *d) {
e->Procedure.is_export = ac.is_export;
e->deprecated_message = ac.deprecated_message;
ac.link_name = handle_link_name(ctx, e->token, ac.link_name, ac.link_prefix);
+ if (ac.has_disabled_proc) {
+ if (ac.disabled_proc) {
+ e->flags |= EntityFlag_Disabled;
+ }
+ Type *t = base_type(e->type);
+ GB_ASSERT(t->kind == Type_Proc);
+ if (t->Proc.result_count != 0) {
+ error(e->token, "Procedure with the 'disabled' attribute may not have any return values");
+ }
+ }
bool is_foreign = e->Procedure.is_foreign;
bool is_export = e->Procedure.is_export;