]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - gdb/testsuite/gdb.cp/paramless.cc
Update copyright year range in header of all files managed by GDB
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.cp / paramless.cc
CommitLineData
ac37b79c
TT
1/* Test case for template breakpoint test.
2
1d506c26 3 Copyright 2022-2024 Free Software Foundation, Inc.
ac37b79c
TT
4
5 This file is part of GDB.
6
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3 of the License, or
10 (at your option) any later version.
11
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>. */
19
20template<typename T>
21struct outer
22{
23 template<typename Q = int>
24 int fn (int x)
25 {
26 return x + 23;
27 }
28};
29
30template<typename T = int>
31int toplev (int y)
32{
33 return y;
34}
35
36outer<int> outer1;
37outer<char> outer2;
38
39int main ()
40{
41 int x1 = outer1.fn (0);
42 int x2 = outer2.fn<short> (-46);
43 int x3 = toplev<char> (0);
44 int x4 = toplev (0);
45 return x1 + x2;
46}