--- src/glsl/ast_to_hir.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp index 8d55ee3..b70b628 100644 --- a/src/glsl/ast_to_hir.cpp +++ b/src/glsl/ast_to_hir.cpp @@ -3180,10 +3180,6 @@ ast_declarator_list::hir(exec_list *instructions, const struct glsl_type *var_type; ir_variable *var; - /* FINISHME: Emit a warning if a variable declaration shadows a - * FINISHME: declaration at a higher scope. - */ - if ((decl_type == NULL) || decl_type->is_void()) { if (type_name != NULL) { _mesa_glsl_error(& loc, state, @@ -3197,6 +3193,12 @@ ast_declarator_list::hir(exec_list *instructions, continue; } + if (state->symbols->get_variable(decl->identifier)) { + _mesa_glsl_warning(& loc, state, + "Overriding previous definition of '%s'\n", + decl->identifier); + } + var_type = process_array_type(&loc, decl_type, decl->array_specifier, state); -- 1.8.3.2 _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev