xref: /aosp_15_r20/external/clang/test/SemaObjCXX/arc-memfunc.mm (revision 67e74705e28f6214e480b399dd47ea732279e315)
1*67e74705SXin Li// RUN: %clang_cc1 -fsyntax-only -fobjc-arc -verify -fblocks %s
2*67e74705SXin Li// expected-no-diagnostics
3*67e74705SXin Li
4*67e74705SXin Listruct X0 {
5*67e74705SXin Li  static id makeObject1() __attribute__((ns_returns_retained));
6*67e74705SXin Li  id makeObject2() __attribute__((ns_returns_retained));
7*67e74705SXin Li};
8*67e74705SXin Li
9*67e74705SXin Livoid test_X0(X0 x0, X0 *x0p) {
10*67e74705SXin Li  X0::makeObject1();
11*67e74705SXin Li  x0.makeObject2();
12*67e74705SXin Li  x0p->makeObject2();
13*67e74705SXin Li  id (X0::*pmf)() __attribute__((ns_returns_retained)) = &X0::makeObject2;
14*67e74705SXin Li  (x0.*pmf)();
15*67e74705SXin Li  (x0p->*pmf)();
16*67e74705SXin Li}
17