From 777351a5fdf460dc2a4a2ed6c63a1e0b899512b7 Mon Sep 17 00:00:00 2001 From: Dodji Seketeli Date: Thu, 1 Apr 2010 18:54:30 +0000 Subject: re PR debug/43325 (C++ external inner reference does not override outer scope) Fix for PR debug/43325 gcc/ChangeLog: PR debug/43325 * dwarf2out.c (gen_variable_die): Allow debug info for variable re-declaration when it happens in a function. gcc/testsuite/ChangeLog: PR debug/43325 * c-c++-common/dwarf2/redeclaration-1.C: New test. From-SVN: r157928 --- gcc/dwarf2out.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'gcc/dwarf2out.c') diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 86ae89b..5faa58c 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -18283,9 +18283,9 @@ gen_variable_die (tree decl, tree origin, dw_die_ref context_die) /* If the compiler emitted a definition for the DECL declaration and if we already emitted a DIE for it, don't emit a second - DIE for it again. */ - if (old_die - && declaration) + DIE for it again. Allow re-declarations of DECLs that are + inside functions, though. */ + if (old_die && declaration && !local_scope_p (context_die)) return; /* For static data members, the declaration in the class is supposed -- cgit v1.1