diff options
author | Siva Chandra Reddy <sivachandra@google.com> | 2014-06-02 22:10:57 +0000 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2014-06-02 18:10:57 -0400 |
commit | 1bae589107674080141c3fb69bf234734f162d2b (patch) | |
tree | dc593b8a82e65c9d89f842fb94ee711e67c0c3db /gcc | |
parent | b94f5533504e6a06fd9bf233b50e85bdf8a3d06e (diff) | |
download | gcc-1bae589107674080141c3fb69bf234734f162d2b.zip gcc-1bae589107674080141c3fb69bf234734f162d2b.tar.gz gcc-1bae589107674080141c3fb69bf234734f162d2b.tar.bz2 |
re PR debug/57519 (DW_TAG_imported_declaration put in wrong class (base class instead of derived class))
PR debug/57519
* class.c (handle_using_decl): Pass the correct scope to
cp_emit_debug_info_for_using.
From-SVN: r211151
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/class.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/debug/dwarf2/imported-decl-2.C | 32 |
3 files changed, 39 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 9b439a9..75899e4 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2014-06-02 Siva Chandra Reddy <sivachandra@google.com> + + PR debug/57519 + * class.c (handle_using_decl): Pass the correct scope to + cp_emit_debug_info_for_using. + 2014-06-02 Ville Voutilainen <ville.voutilainen@gmail.com> PR c++/59483 diff --git a/gcc/cp/class.c b/gcc/cp/class.c index 14780e7..110dbf4 100644 --- a/gcc/cp/class.c +++ b/gcc/cp/class.c @@ -1298,7 +1298,7 @@ handle_using_decl (tree using_decl, tree t) old_value = NULL_TREE; } - cp_emit_debug_info_for_using (decl, USING_DECL_SCOPE (using_decl)); + cp_emit_debug_info_for_using (decl, t); if (is_overloaded_fn (decl)) flist = decl; diff --git a/gcc/testsuite/g++.dg/debug/dwarf2/imported-decl-2.C b/gcc/testsuite/g++.dg/debug/dwarf2/imported-decl-2.C new file mode 100644 index 0000000..ce01f72 --- /dev/null +++ b/gcc/testsuite/g++.dg/debug/dwarf2/imported-decl-2.C @@ -0,0 +1,32 @@ +// { dg-do compile } +// { dg-options "-gdwarf-2 -dA -O0 -fno-merge-debug-strings" } + +class AAAA +{ + public: + int method (void); + int a; +}; + +int +AAAA::method (void) +{ + return a; +} + +class BBBB : public AAAA +{ + public: + using AAAA::method; + + int method (int b); +}; + +int +BBBB::method (int b) +{ + return a + b; +} + +// { dg-final { scan-assembler-not "ascii \"BBBB\\\\0\".*ascii \"AAAA\\\\0\".*DW_TAG_imported_declaration" } } +// { dg-final { scan-assembler-times "ascii \"AAAA\\\\0\".*ascii \"BBBB\\\\0\".*DIE .0x\[0-9a-f\]*. DW_TAG_imported_declaration" 1 } } |