Add translations for various sub-directories
[binutils-gdb.git] / gdb / testsuite / gdb.cp / paramless.cc
blob4fa54fb067f2083635b41076ca9873ec9d2af3ff
1 /* Test case for template breakpoint test.
3 Copyright 2022-2024 Free Software Foundation, Inc.
5 This file is part of GDB.
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.
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.
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/>. */
20 template<typename T>
21 struct outer
23 template<typename Q = int>
24 int fn (int x)
26 return x + 23;
30 template<typename T = int>
31 int toplev (int y)
33 return y;
36 outer<int> outer1;
37 outer<char> outer2;
39 int main ()
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;