CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
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);
|
|
}
|