Issue error on "void" typed variable, function parameter, or struct member.
This commit is contained in:
@@ -237,6 +237,11 @@ Module::AddGlobalVariable(Symbol *sym, Expr *initExpr, bool isConst) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (sym->type == AtomicType::Void) {
|
||||
Error(sym->pos, "\"void\" type global variable is illegal.");
|
||||
return;
|
||||
}
|
||||
|
||||
sym->type = ArrayType::SizeUnsizedArrays(sym->type, initExpr);
|
||||
if (sym->type == NULL)
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user