aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.cp/mb-templates.cc
blob: 649d7eda69fbaa4e2aa1ca3fcf8f15f553ebc7b0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31

#include <iostream>
using namespace std;

template<class T>
void foo(T i)
{
  std::cout << "hi\n"; // set breakpoint here
}

template<class T>
void multi_line_foo(T i)
{
  std::cout // set multi-line breakpoint here
    << "hi\n";
}

int main()
{
    foo<int>(0);
    foo<double>(0);
    foo<int>(1);
    foo<double>(1);
    foo<int>(2);
    foo<double>(2);

    multi_line_foo<int>(0);
    multi_line_foo<double>(0);

    return 0;
}