This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [rfa] handle integer downsizing correctly in C++ overloading


On 31 Jan 2003 11:57:29 -0800, David Carlton <carlton@math.Stanford.EDU> said:

> And there's a testsuite patch included to catch this as well.

Whoops, I forgot to include the testsuite patch; here it is, if
anybody's curious.

David Carlton
carlton@math.stanford.edu

2003-01-31  David Carlton  <carlton@math.stanford.edu>

	* gdb.c++/overload.exp: Test intToChar(1).
	* gdb.c++/overload.cc (intToChar): New.
	(main): Call intToChar.

Index: overload.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.c++/overload.exp,v
retrieving revision 1.9
diff -u -p -r1.9 overload.exp
--- overload.exp	13 Jan 2003 20:09:33 -0000	1.9
+++ overload.exp	31 Jan 2003 19:20:38 -0000
@@ -378,3 +378,5 @@ gdb_test "list foo::overloadfnarg(int, i
 gdb_test "list \"foo::overloadfnarg(int, int (*)(int))\"" \
    "int foo::overloadfnarg.*\\(int arg, int \\(\\*foo\\) \\(int\\)\\).*" \
    "list overloaded function with function ptr args - quotes around argument"
+
+gdb_test "print intToChar(1)" ".\[0-9\]* = 297"
Index: overload.cc
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.c++/overload.cc,v
retrieving revision 1.1.1.3
diff -u -p -r1.1.1.3 overload.cc
--- overload.cc	22 Sep 1999 03:26:23 -0000	1.1.1.3
+++ overload.cc	31 Jan 2003 19:24:11 -0000
@@ -45,6 +45,11 @@ int overloadargs (int a1, int a2, int a3
 
 };
 
+int intToChar (char c)
+{
+  return 297;
+}
+
 void marker1()
 {}
 
@@ -72,6 +77,8 @@ int main () 
        breakpoint();
     #endif
 
+    // Verify that intToChar should work:
+    intToChar(1);
 
     marker1();
     return 0; 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]