[patch/testsuite/cp] derivation.exp: cosmetic bug in protected inheritance

Michael Elizabeth Chastain mec.gnu@mindspring.com
Wed Jan 14 03:55:00 GMT 2004


This patch detects a cosmetic bug with protected inheritance.
The bug is:

  class B { ... };
  class D : protected B { ... };

  (gdb) ptype D
  type = class D: private B { ... };

This was a simple bug in gcc; it just didn't test for "protected"
in dbxout.c.  Andrew Pinskia has fixed the bug in gcc HEAD.

So, this patch improves derivation.exp to give a result of XFAIL
rather than PASS on this output.

Tested on:

  native i686-pc-linux-gnu, gcc 2.95.3 3.3.2 HEAD, dwarf-2 stabs+

IACTN,

Michael C

2004-01-13  Michael Chastain  <mec.gnu@mindspring.com>

	* gdb.cp/derivation.exp: Add XFAIL for bug with protected
	inheritance.  PR gdb/1498, PR gcc/13539.

Index: gdb.cp/derivation.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.cp/derivation.exp,v
retrieving revision 1.5
diff -c -3 -p -r1.5 derivation.exp
*** gdb.cp/derivation.exp	9 Jan 2004 04:57:09 -0000	1.5
--- gdb.cp/derivation.exp	14 Jan 2004 03:46:56 -0000
*************** gdb_test_multiple "ptype d_instance" "pt
*** 111,124 ****
  	pass "ptype d_instance"
      }
      -re "type = $XX_class${ws}$re_fields${ws}$re_methods${ws}$re_synth_gcc_23$nl\}$nl$gdb_prompt $" {
! 	# TODO: this is a gcc bug
! 	# kfail "gdb/1498" "ptype d_instance"
! 	pass "ptype d_instance"
      }
      -re "type = $XX_class${ws}$re_fields${ws}$re_all_methods$nl\}$nl$gdb_prompt $" {
! 	# TODO: this is a gcc bug.
! 	# kfail "gdb/1498" "ptype d_instance"
! 	pass "ptype d_instance"
      }
  }
  
--- 111,126 ----
  	pass "ptype d_instance"
      }
      -re "type = $XX_class${ws}$re_fields${ws}$re_methods${ws}$re_synth_gcc_23$nl\}$nl$gdb_prompt $" {
! 	# This is a gcc bug, gcc/13539, gdb/1498.
! 	# Fixed in gcc HEAD 2004-01-13
! 	setup_xfail "*-*-*" "gcc/13539"
! 	fail "ptype d_instance"
      }
      -re "type = $XX_class${ws}$re_fields${ws}$re_all_methods$nl\}$nl$gdb_prompt $" {
! 	# This is a gcc bug, gcc/13539, gdb/1498.
! 	# Fixed in gcc HEAD 2004-01-13
! 	setup_xfail "*-*-*" "gcc/13539"
! 	fail "ptype d_instance"
      }
  }
  
*************** gdb_test_multiple "ptype e_instance" "pt
*** 145,158 ****
  	pass "ptype e_instance"
      }
      -re "type = $XX_class${ws}$re_fields${ws}$re_methods${ws}$re_synth_gcc_23$nl\}$nl$gdb_prompt $" {
! 	# TODO: this is a gcc bug.
! 	# kfail "gdb/1498" "ptype e_instance"
! 	pass "ptype e_instance"
      }
      -re "type = $XX_class${ws}$re_fields${ws}$re_all_methods$nl\}$nl$gdb_prompt $" {
! 	# TODO: this is a gcc bug.
! 	# kfail "gdb/1498" "ptype e_instance"
! 	pass "ptype e_instance"
      }
  }
  
--- 147,162 ----
  	pass "ptype e_instance"
      }
      -re "type = $XX_class${ws}$re_fields${ws}$re_methods${ws}$re_synth_gcc_23$nl\}$nl$gdb_prompt $" {
! 	# This is a gcc bug, gcc/13539, gdb/1498.
! 	# Fixed in gcc HEAD 2004-01-13
! 	setup_xfail "*-*-*" "gcc/13539"
! 	fail "ptype e_instance"
      }
      -re "type = $XX_class${ws}$re_fields${ws}$re_all_methods$nl\}$nl$gdb_prompt $" {
! 	# This is a gcc bug, gcc/13539, gdb/1498.
! 	# Fixed in gcc HEAD 2004-01-13
! 	setup_xfail "*-*-*" "gcc/13539"
! 	fail "ptype e_instance"
      }
  }
  



More information about the Gdb-patches mailing list