diff options
| author | gingerBill <bill@gingerbill.org> | 2021-05-19 11:51:48 +0100 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2021-05-19 11:51:48 +0100 |
| commit | 26ce40c188c31539cbf7f97cf2ad1bb81000bc55 (patch) | |
| tree | f419f57f36823ac20f51393aae0f8b0a1ffef224 /src/check_decl.cpp | |
| parent | b34e4a9fd1fad2548c90624504ff8ce420cfeccc (diff) | |
Remove @(static) for global variables
Diffstat (limited to 'src/check_decl.cpp')
| -rw-r--r-- | src/check_decl.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/check_decl.cpp b/src/check_decl.cpp index 5e8e79791..0aef40546 100644 --- a/src/check_decl.cpp +++ b/src/check_decl.cpp @@ -899,10 +899,9 @@ void check_global_variable_decl(CheckerContext *ctx, Entity *&e, Ast *type_expr, e->Variable.thread_local_model = ac.thread_local_model; e->Variable.is_export = ac.is_export; + e->flags &= ~EntityFlag_Static; if (ac.is_static) { - e->flags |= EntityFlag_Static; - } else { - e->flags &= ~EntityFlag_Static; + error(e->token, "@(static) is not supported for global variables, nor required"); } ac.link_name = handle_link_name(ctx, e->token, ac.link_name, ac.link_prefix); |