diff options
author | Tom Tromey <tromey@redhat.com> | 2013-05-22 20:51:49 +0000 |
---|---|---|
committer | Tom Tromey <tromey@redhat.com> | 2013-05-22 20:51:49 +0000 |
commit | 5f2e6b00f863fc8f334d2506b96b055ef70394ed (patch) | |
tree | de025e8ae9b9dc5499d9c750267e9609d6ab2d43 /gdb/testsuite | |
parent | c77c0862b26d536f91187c34c510cee96bef1f7a (diff) | |
download | gdb-5f2e6b00f863fc8f334d2506b96b055ef70394ed.zip gdb-5f2e6b00f863fc8f334d2506b96b055ef70394ed.tar.gz gdb-5f2e6b00f863fc8f334d2506b96b055ef70394ed.tar.bz2 |
PR c++/15401:
* c-valprint.c (c_value_print): Use value_addr for
references. Convert back to reference type with value_ref.
gdb/testsuite
* gdb.cp/class2.cc (main): New local 'aref'.
* gdb.cp/class2.exp: Check printing of 'aref'.
Diffstat (limited to 'gdb/testsuite')
-rw-r--r-- | gdb/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/testsuite/gdb.cp/class2.cc | 1 | ||||
-rw-r--r-- | gdb/testsuite/gdb.cp/class2.exp | 4 |
3 files changed, 10 insertions, 0 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 300eb75..7429c35 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2013-05-22 Tom Tromey <tromey@redhat.com> + + * gdb.cp/class2.cc (main): New local 'aref'. + * gdb.cp/class2.exp: Check printing of 'aref'. + 2013-05-22 Doug Evans <dje@google.com> * gdb.threads/wp-replication.c (main): Insert some code at the start diff --git a/gdb/testsuite/gdb.cp/class2.cc b/gdb/testsuite/gdb.cp/class2.cc index 0c9d9df..97c44de 100644 --- a/gdb/testsuite/gdb.cp/class2.cc +++ b/gdb/testsuite/gdb.cp/class2.cc @@ -67,6 +67,7 @@ int main (void) B beta, *bbp; C gamma; empty e; + A &aref (alpha); alpha.a1 = 100; beta.a1 = 200; beta.b1 = 201; beta.b2 = 202; diff --git a/gdb/testsuite/gdb.cp/class2.exp b/gdb/testsuite/gdb.cp/class2.exp index 824f56e..00b6322 100644 --- a/gdb/testsuite/gdb.cp/class2.exp +++ b/gdb/testsuite/gdb.cp/class2.exp @@ -110,3 +110,7 @@ gdb_test_no_output "set print object on" gdb_test "p acp" "= \\(C \\*\\) ${hex}" gdb_test "p acp->c1" "\\(A \\*\\) 0x0" gdb_test "p acp->c2" "\\(A \\*\\) ${hex}f" + +# Regression test for PR c++/15401. +# Check that the type printed is a reference. +gdb_test "p aref" " = \\(A \\&\\) .*" |