* gdb.c++/classes.exp: Add test for static member function.
authorDaniel Jacobowitz <drow@false.org>
Fri, 7 Dec 2001 21:58:19 +0000 (21:58 +0000)
committerDaniel Jacobowitz <drow@false.org>
Fri, 7 Dec 2001 21:58:19 +0000 (21:58 +0000)
        * gdb.c++/misc.cc: Add class with static member function.

gdb/testsuite/ChangeLog
gdb/testsuite/gdb.c++/classes.exp
gdb/testsuite/gdb.c++/misc.cc

index 2d30b1b8b79138a7bb93279e4e496bd4235589e3..7c6d03fcee69056b2fc352cc09987e9943afc26e 100644 (file)
@@ -1,3 +1,8 @@
+2001-12-07  Daniel Jacobowitz  <drow@mvista.com>
+
+       * gdb.c++/classes.exp: Add test for static member function.
+       * gdb.c++/misc.cc: Add class with static member function.
+
 2001-12-07  Jim Blandy  <jimb@redhat.com>
 
        If GDB says it can't find the struct the function returned, report
index 5b559d728d662815a695742c4d4f616d6739a6fb..68142eb4a256a1b8d9ca9be2622d49d489210ded 100644 (file)
@@ -308,6 +308,22 @@ proc test_ptype_class_objects {} {
        }
     }
 
+    # With g++ 2.x and stabs debug info, we misinterpret static methods
+    # whose name matches their argument mangling.
+    send_gdb "ptype class Static\n"
+    gdb_expect {
+       -re "type = (class|struct) Static \{(${ws}public:|)${ws}Static & operator=\\(Static const ?&\\);${ws}Static\\(Static const ?&\\);${ws}Static\\((void|)\\);${ws}static void ii\\(int, int\\);${ws}\}$nl$gdb_prompt $" {
+           pass "ptype class Static"
+       }
+       -re ".*$gdb_prompt $" {
+           fail "ptype class Static"
+       }
+       timeout {
+           fail "ptype class Static (timeout)"
+           return
+       }
+    }
+
     send_gdb "ptype class vA\n"
     gdb_expect {
        -re "type = (class|struct) vA \{(${ws}public:|)${ws}int va;${ws}int vx;${ws}vA & operator=\\(vA const &\\);${ws}vA\\(vA const &\\);${ws}vA\\((void|)\\);${ws}\}$nl$gdb_prompt $" {
index caa54511838b33c827ce1f88f6ae956bc6e85ebd..286c02bc6df3200647bb610a60653ccfdc81063a 100644 (file)
@@ -269,6 +269,14 @@ void inheritance1 (void)
   inheritance2 ();     
 }
 
+// ======================== static member functions =====================
+
+class Static {
+public:
+  static void ii(int, int);
+};
+void Static::ii (int, int) { }
+
 // ======================== virtual base classes=========================
 
 class vA {
This page took 0.030824 seconds and 4 git commands to generate.