pike.git/
src/
program.c
Branch:
Tag:
Non-build tags
All tags
No tags
2016-10-30
2016-10-30 11:44:23 by Henrik Grubbström (Grubba) <grubba@grubba.org>
35867469884b12e7d7050bd91d059807f15bbb5e (
28
lines) (+
24
/-
4
)
[
Show
|
Annotate
]
Branch:
8.1
Compiler: Warn about unreachable variant functions.
4136:
/* NB: The dispatcher needs the variant references to * not get overloaded for the ::-operator to work. */
-
prog
->
identifier_references[j].
id_flags |= ID_LOCAL;
+
ref
->id_flags |= ID_LOCAL;
+
if (type)
{ struct pike_type * temp = type;
-
+
if ((Pike_compiler->compiler_pass == 2) && !ref->inherit_offset &&
+
!check_variant_overload(id->type, type)) {
+
/* This symbol is shadowed by later variants. */
+
yytype_report(REPORT_WARNING,
+
NULL, 0, NULL,
+
Pike_compiler->new_program->strings[id->filename_strno],
+
id->linenumber, id->type,
+
0, "Variant of function %S masked by later variant(s).",
+
name);
+
ref_push_type_value(type);
+
low_yyreport(REPORT_WARNING,
+
Pike_compiler->new_program->strings[id->filename_strno],
+
id->linenumber,
+
type_check_system_string,
+
1, "Aggregated type: %O.");
+
}
type = or_pike_types(type, id->type, 1);
-
if
(temp)
free
_
type
(
temp
);
+
free_type
(temp)
;
+
} else {
+
add
_
ref(
type
= id->type
);
} #ifdef COMPILER_DEBUG fprintf(stderr, "type: ");