mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-10 15:22:04 +00:00
warn when a top-level local shadows a parameter
This commit is contained in:
parent
70194567fe
commit
e38259e01f
1 changed files with 7 additions and 1 deletions
|
@ -312,8 +312,14 @@ def_name
|
|||
{
|
||||
int *alloc = &numpr_globals;
|
||||
|
||||
if (pr_scope)
|
||||
if (pr_scope) {
|
||||
alloc = pr_scope->alloc;
|
||||
if (pr_scope->scope && !pr_scope->scope->scope) {
|
||||
def_t *def = PR_GetDef (0, $1, pr_scope->scope, 0);
|
||||
if (def && def->scope && !def->scope->scope)
|
||||
warning (0, "local %s shadows param %s", $1, def->name);
|
||||
}
|
||||
}
|
||||
$$ = PR_GetDef (current_type, $1, pr_scope, alloc);
|
||||
current_def = $$;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue