]>
git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - gdb/testsuite/gdb.linespec/cp-replace-typedefs-ns-template.cc
1 /* This testcase is part of GDB, the GNU debugger.
3 Copyright 2019-2022 Free Software Foundation, Inc.
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 3 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>. */
29 typedef object
*object_p
;
34 explicit Templ1 (object_p
)
40 static_method (object_p
)
45 template<typename T
, typename U
>
48 explicit Templ2 (object_p
)
54 static_method (object_p
)
59 template<typename T
> using AliasTempl
= Templ2
<int, T
>;
61 typedef Templ1
<int> int_Templ1_t
;
64 object_p_func (object_p
)
69 int_Templ1_t_func (int_Templ1_t
*)
77 /* These typedefs have the same name as some of the components within
78 NS1 that they alias to, on purpose, to try to confuse GDB and cause
81 using object
= NS1::NS2::object
;
82 using Templ1
= NS1::NS2::Templ1
<unsigned>;
83 using Templ2
= NS1::NS2::Templ2
<long, long>;
84 using AliasTempl
= NS1::NS2::AliasTempl
<int>;
89 NS1::NS2::int_Templ1_t
int_templ1 (0);
95 NS1::NS2::Templ1
<int>::static_method
<int> (0);
96 NS1::NS2::AliasTempl
<int>::static_method
<int> (0);
97 NS1::NS2::object_p_func (0);
98 NS1::NS2::int_Templ1_t_func (0);