diff options
| author | gingerBill <bill@gingerbill.org> | 2019-02-23 22:17:27 +0000 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2019-02-23 22:17:27 +0000 |
| commit | a9ab90bd2488783c3523fa30315f9754937fd52e (patch) | |
| tree | 17c7e5398a7b95f106ccece88f709c0887750837 /src/check_decl.cpp | |
| parent | e551d2b25ea39afb95f7b8ee4309ef0cc8b502b8 (diff) | |
Make `static` an attribute rather than a keyword prefix
Diffstat (limited to 'src/check_decl.cpp')
| -rw-r--r-- | src/check_decl.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/check_decl.cpp b/src/check_decl.cpp index e9d6d5860..c2796e1da 100644 --- a/src/check_decl.cpp +++ b/src/check_decl.cpp @@ -718,9 +718,14 @@ void check_var_decl(CheckerContext *ctx, Entity *e, Ast *type_expr, Ast *init_ex check_decl_attributes(ctx, decl->attributes, var_decl_attribute, &ac); } + e->Variable.thread_local_model = ac.thread_local_model; e->Variable.is_export = ac.is_export; + if (ac.is_static) { + e->flags |= EntityFlag_Static; + } else { + e->flags &= ~EntityFlag_Static; + } ac.link_name = handle_link_name(ctx, e->token, ac.link_name, ac.link_prefix); - e->Variable.thread_local_model = ac.thread_local_model; String context_name = str_lit("variable declaration"); |