xref: /aosp_15_r20/external/clang/test/SemaObjCXX/arc-ppe.mm (revision 67e74705e28f6214e480b399dd47ea732279e315)
1*67e74705SXin Li// RUN: %clang_cc1 -fsyntax-only -verify -fobjc-arc %s
2*67e74705SXin Li
3*67e74705SXin Li// Make sure the ARC auto-deduction of id* in unevaluated contexts
4*67e74705SXin Li// works correctly in cases where we can't immediately tell whether the
5*67e74705SXin Li// context is unevaluated.
6*67e74705SXin Li
7*67e74705SXin Linamespace std {
8*67e74705SXin Li  class type_info;
9*67e74705SXin Li}
10*67e74705SXin Li
11*67e74705SXin Liint& NP(void*);
12*67e74705SXin Livoid test1() { (void)typeid(NP((void*)(id*)0)); }
13*67e74705SXin Li
14*67e74705SXin Liclass Poly { virtual ~Poly(); };
15*67e74705SXin LiPoly& P(void*);
16*67e74705SXin Livoid test2() { (void)typeid(P((void*)(id*)0)); } // expected-error {{pointer to non-const type 'id'}} expected-warning {{expression with side effects will be evaluated despite being used as an operand to 'typeid'}}
17