Files
clang-p2996/lldb/test/API/lang/cpp/no_unique_address/main.cpp
Michael Buch 9548dbedbc [lldb][test] Add TestNoUniqueAddress.py
Tests that run expressions on record types with
`[[no_unique_address]]` fields.
2024-09-16 12:05:00 +01:00

36 lines
447 B
C++

struct Empty {};
namespace basic {
struct Foo {
[[no_unique_address]] Empty a;
};
} // namespace basic
namespace bases {
struct A {
long c, d;
};
struct B {
[[no_unique_address]] Empty x;
};
struct C {
[[no_unique_address]] Empty x;
};
struct Foo : B, A, C {};
struct Bar : B, C, A {};
} // namespace bases
int main() {
basic::Foo b1;
bases::Foo b2;
bases::Bar b3;
b2.c = 1;
b2.d = 2;
b3.c = 5;
b3.d = 6;
return 0;
}