[patch/testsuite/cp] templates.exp: accept "Foo<(char*)&string)"

Michael Elizabeth Chastain
2004-03-12T16:39:19Z

This patch improves templates.exp to accept this:

(gdb) ptype quxint
type = class Qux<int, (char *)(&string)> ...

This happens with gcc gcc-3_4-branch, gcc HEAD, and gcc
tree-ssa-200206129-branch with stabs+.

I tested this on:

native i686-pc-linux-gnu
gcc 2.95.3, 3.2-7-rh, 3.3.3, gcc-3_3-branch, gcc-3_4-branch, HEAD, tree-ssa-20020619-branch
dwarf-2, stabs+

We had some discussion about this earlier and drow and carlton are
okay with accepting the "(char *)(&string)" form.

I am committing this to gdb HEAD now. I am going to test it
on the branch and commit to the branch as well.

Michael C

2004-03-12 Michael Chastain <mec.gnu@mindspring.com>

* gdb.cp/templates.exp: Accept more template types.

Index: templates.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.cp/templates.exp,v
retrieving revision 1.9
diff -c -3 -p -r1.9 templates.exp
*** templates.exp 11 Feb 2004 14:01:25 -0000 1.9
--- templates.exp 12 Mar 2004 16:34:01 -0000
*************** send_gdb "ptype quxint\n"
*** 455,460 ****
--- 455,461 ----
gdb_expect {
-re "type = class Qux<int, ?&string> \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*int t;\r\n\r\n\[ \t\]*.*int qux\\(int, int\\);\r\n\\}\r\n$gdb_prompt $" { pass "ptype quxint" }
-re "type = class Qux<int, ?&string> \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*int t;\r\n\r\n\[ \t\]*int qux\\(int, int\\);.*\r\n\\}\r\n$gdb_prompt $" { pass "ptype quxint" }
+ -re "type = class Qux<int, ?\\(char ?\\*\\)\\(&string\\)> \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*int t;\r\n\r\n\[ \t\]*int qux\\(int, int\\);.*\r\n\\}\r\n$gdb_prompt $" { pass "ptype quxint" }
-re "type = class Qux<int, ?&\\(string\\)> \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*int t;\r\n\r\n\[ \t\]*int qux\\(int, int\\);.*\r\n\\}\r\n$gdb_prompt $" {
kfail "gdb/1512" "ptype quxint"
}