Files
TheRock/debug-tools/rocgdb/source/gdb/testsuite/gdb.cp/mb-ctor.cc
T
derek.holloway 7502bf64a4
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
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

75 lines
1.3 KiB
C++

#include <stdio.h>
class Base
{
public:
Base(int k);
~Base();
virtual void foo() {}
private:
int k;
};
Base::Base(int k)
{
this->k = k;
}
Base::~Base()
{
printf("~Base\n");
}
class Derived : public virtual Base
{
public:
Derived(int i);
~Derived();
private:
int i;
int i2;
};
Derived::Derived(int i) : Base(i)
{
this->i = i;
/* The next statement is spread over two lines on purpose to exercise
a bug where breakpoints set on all but the last line of a statement
would not get multiple breakpoints.
The second line's text for gdb_get_line_number is a subset of the
first line so that we don't care which line gdb prints when it stops. */
this->i2 = // set breakpoint here
i; // breakpoint here
}
Derived::~Derived()
{
printf("~Derived\n");
}
class DeeplyDerived : public Derived
{
public:
DeeplyDerived(int i) : Base(i), Derived(i) {}
};
int main()
{
/* Invokes the Derived ctor that constructs both
Derived and Base. */
Derived d(7);
/* Invokes the Derived ctor that constructs only
Derived. Base is constructed separately by
DeeplyDerived's ctor. */
DeeplyDerived dd(15);
Derived *dyn_d = new Derived (24);
DeeplyDerived *dyn_dd = new DeeplyDerived (42);
delete dyn_d;
delete dyn_dd;
return 0;
}