diff options
author | Dodji Seketeli <dodji@redhat.com> | 2010-04-01 18:54:30 +0000 |
---|---|---|
committer | Dodji Seketeli <dodji@gcc.gnu.org> | 2010-04-01 20:54:30 +0200 |
commit | 777351a5fdf460dc2a4a2ed6c63a1e0b899512b7 (patch) | |
tree | b6732222ccf4fafc095cadf5cc496e8153d3b0ab /gcc/dwarf2out.c | |
parent | d4b5fb2238f98fedbf123d80714b2ab1b0ceff2d (diff) | |
download | gcc-777351a5fdf460dc2a4a2ed6c63a1e0b899512b7.zip gcc-777351a5fdf460dc2a4a2ed6c63a1e0b899512b7.tar.gz gcc-777351a5fdf460dc2a4a2ed6c63a1e0b899512b7.tar.bz2 |
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
Diffstat (limited to 'gcc/dwarf2out.c')
-rw-r--r-- | gcc/dwarf2out.c | 6 |
1 files changed, 3 insertions, 3 deletions
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 |