diff options
| author | CiD- <jkercher43@gmail.com> | 2022-03-14 13:36:22 -0400 |
|---|---|---|
| committer | CiD- <jkercher43@gmail.com> | 2022-03-14 13:36:22 -0400 |
| commit | 1f4e5e919f94b53ea2ed9292b4a9a33488026fcf (patch) | |
| tree | a073ea401866d4d4a1b83ea819de9c2c2e3893e2 /src/check_type.cpp | |
| parent | c293e88f2e31bfed896ddba701bdc2629497005a (diff) | |
| parent | 1d147ba99339afbef47bf689a0e0d7591a33c633 (diff) | |
merge upstream/master
Diffstat (limited to 'src/check_type.cpp')
| -rw-r--r-- | src/check_type.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/check_type.cpp b/src/check_type.cpp index 64fb67723..ecb2c26ea 100644 --- a/src/check_type.cpp +++ b/src/check_type.cpp @@ -2031,10 +2031,14 @@ bool check_procedure_type(CheckerContext *ctx, Type *type, Ast *proc_type_node, if (param_count > 0) { Entity *end = params->Tuple.variables[param_count-1]; if (end->flags&EntityFlag_CVarArg) { - if (cc == ProcCC_StdCall || cc == ProcCC_CDecl) { + switch (cc) { + default: type->Proc.c_vararg = true; - } else { + break; + case ProcCC_Odin: + case ProcCC_Contextless: error(end->token, "Calling convention does not support #c_vararg"); + break; } } } @@ -2170,7 +2174,7 @@ void init_map_entry_type(Type *type) { /* struct { - hash: runtime.Map_Hash, + hash: uintptr, next: int, key: Key, value: Value, @@ -3027,5 +3031,7 @@ Type *check_type_expr(CheckerContext *ctx, Ast *e, Type *named_type) { } set_base_type(named_type, type); + check_rtti_type_disallowed(e, type, "Use of a type, %s, which has been disallowed"); + return type; } |