xref: /llvm-project/lldb/test/API/lang/cpp/function-ref-qualifiers/main.cpp (revision 60eb06be6d23e3c5fd80113143784aac0d962965)
1*60eb06beSMichael Buch #include <cstdint>
2*60eb06beSMichael Buch #include <cstdio>
3*60eb06beSMichael Buch 
4*60eb06beSMichael Buch struct Foo {
funcFoo5*60eb06beSMichael Buch   uint32_t func() const & { return 0; }
funcFoo6*60eb06beSMichael Buch   int64_t func() const && { return 1; }
funcFoo7*60eb06beSMichael Buch   uint32_t func() & { return 2; }
funcFoo8*60eb06beSMichael Buch   int64_t func() && { return 3; }
9*60eb06beSMichael Buch };
10*60eb06beSMichael Buch 
main()11*60eb06beSMichael Buch int main() {
12*60eb06beSMichael Buch   Foo foo;
13*60eb06beSMichael Buch   const Foo const_foo;
14*60eb06beSMichael Buch   auto res = foo.func() + const_foo.func() + Foo{}.func() +
15*60eb06beSMichael Buch              static_cast<Foo const &&>(Foo{}).func();
16*60eb06beSMichael Buch 
17*60eb06beSMichael Buch   std::puts("Break here");
18*60eb06beSMichael Buch   return res;
19*60eb06beSMichael Buch }
20