1 | #include <cstdio> |
---|---|
2 | #include <cstdlib> |
3 | |
4 | void func(int in); |
5 | |
6 | struct Foo { |
7 | int x; |
8 | [[clang::noinline]] void bar(char **argv); |
9 | }; |
10 | |
11 | int main(int argc, char **argv) { |
12 | Foo f{.x = 5}; |
13 | std::printf(format: "%p\n", &f.x); |
14 | f.bar(argv); |
15 | return f.x; |
16 | } |
17 | |
18 | void Foo::bar(char **argv) { |
19 | std::printf(format: "%p %p\n", argv, this); |
20 | std::abort(); /// 'this' should be still accessible |
21 | } |
22 | |
23 | void func(int in) { printf(format: "%d\n", in); } |
24 |