mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2025-01-06 12:09:26 +08:00
1d506c26d9
This commit is the result of the following actions: - Running gdb/copyright.py to update all of the copyright headers to include 2024, - Manually updating a few files the copyright.py script told me to update, these files had copyright headers embedded within the file, - Regenerating gdbsupport/Makefile.in to refresh it's copyright date, - Using grep to find other files that still mentioned 2023. If these files were updated last year from 2022 to 2023 then I've updated them this year to 2024. I'm sure I've probably missed some dates. Feel free to fix them up as you spot them.
92 lines
2.1 KiB
C++
92 lines
2.1 KiB
C++
/* Copyright 2015-2024 Free Software Foundation, Inc.
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
it under the terms of the GNU General Public License as published by
|
|
the Free Software Foundation; either version 3 of the License, or
|
|
(at your option) any later version.
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
GNU General Public License for more details.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
|
|
|
class A;
|
|
static int get_value (const A* a);
|
|
|
|
class A
|
|
{
|
|
public:
|
|
typedef int ATYPE;
|
|
|
|
A () : a_ (21) {}
|
|
ATYPE get_var () { return a_; }
|
|
ATYPE get_var (unsigned long a) { return 100; }
|
|
ATYPE get_var (ATYPE a) { return 101; }
|
|
ATYPE get_var (float a) { return 102; }
|
|
ATYPE get_var (void *a) { return 103;}
|
|
ATYPE get_var (A& lr) { return 104; }
|
|
ATYPE get_var (A const& lr) { return 105; }
|
|
|
|
ATYPE get_var1 (int n) { return a_ << n; }
|
|
ATYPE get_var2 (int incr, unsigned n) { return (a_ + incr) << n; }
|
|
|
|
static ATYPE get_1 (int a) { return a + 1; }
|
|
static ATYPE get_2 (int a, int b) { return a + b + 2; }
|
|
|
|
friend ATYPE get_value (const A*);
|
|
|
|
private:
|
|
ATYPE a_;
|
|
};
|
|
|
|
static A::ATYPE
|
|
get_value (A::ATYPE a)
|
|
{
|
|
return a;
|
|
}
|
|
|
|
static A::ATYPE
|
|
get_value (const A* a)
|
|
{
|
|
return a->a_;
|
|
}
|
|
|
|
static A::ATYPE
|
|
get_value ()
|
|
{
|
|
return 200;
|
|
}
|
|
|
|
typedef int (A::*PMF) (A::ATYPE);
|
|
|
|
int
|
|
main ()
|
|
{
|
|
A *a = new A ();
|
|
int var = 1234;
|
|
float f = 1.23;
|
|
unsigned long ul = 0xdeadbeef;
|
|
A const* ac = a;
|
|
|
|
PMF pmf = &A::get_var;
|
|
PMF *pmf_p = &pmf;
|
|
|
|
var -= a->get_var (); // break here
|
|
var -= a->get_var (1);
|
|
var -= a->get_var (ul);
|
|
var -= a->get_var (f);
|
|
var -= a->get_var (a);
|
|
var -= a->get_var (*a);
|
|
var -= a->get_var (*ac);
|
|
var -= a->get_var1 (1);
|
|
var -= a->get_var2 (1, 2);
|
|
var += (a->*pmf) (1);
|
|
var -= (a->**pmf_p) (1);
|
|
|
|
return var - A::get_1 (1) + A::get_2 (1, 2) + get_value ()
|
|
+ get_value (get_value ()) + get_value (a);
|
|
}
|