(main): Declare two instances of GetMax.
* gdb.cp/templates.exp: Add new test.
+2009-04-27 Jerome Guitton <guitton@adacore.com>
+
+ * gdb.cp/templates.cc (GetMax): New template.
+ (main): Declare two instances of GetMax.
+ * gdb.cp/templates.exp: Add new test.
+
2009-04-27 Jan Kratochvil <jan.kratochvil@redhat.com>
* gdb.cp/abstract-origin.exp, gdb.cp/abstract-origin.cc: New test.
T5<T>::value()
{ return val; }
+template <class T>
+T GetMax (T a, T b) {
+ T result;
+ result = (a>b)? a : b;
+ // set breakpoint on a line with no real code
+ return (result);
+}
#if ! defined(__GNUC__) || defined(GCC_BUG)
template<class T>
int main()
{
int i;
+ long l, m, n;
#ifdef usestubs
set_debug_traps();
breakpoint();
y = x + fc.x;
+ i=GetMax<int>(x,y);
+ n=GetMax<long>(l,m);
return 0;
"Breakpoint.*at.* file .*${testfile}.cc, line.*" \
"value method breakpoint"
+ set bp_location [gdb_get_line_number \
+ "set breakpoint on a line with no real code"]
+ gdb_test "break ${testfile}.cc:${bp_location}" \
+ "Breakpoint.*at.* file .*${testfile}.cc, line.*(2 locations).*" \
+ "breakpoint on a line with no real code"
delete_breakpoints
}