1f4a2713aSLionel Sambuc// RUN: %clang_cc1 -fsyntax-only -verify -fobjc-arc %s 2f4a2713aSLionel Sambuc 3f4a2713aSLionel Sambuc// Make sure the ARC auto-deduction of id* in unevaluated contexts 4f4a2713aSLionel Sambuc// works correctly in cases where we can't immediately tell whether the 5f4a2713aSLionel Sambuc// context is unevaluated. 6f4a2713aSLionel Sambuc 7f4a2713aSLionel Sambucnamespace std { 8f4a2713aSLionel Sambuc class type_info; 9f4a2713aSLionel Sambuc} 10f4a2713aSLionel Sambuc 11f4a2713aSLionel Sambucint& NP(void*); 12f4a2713aSLionel Sambucvoid test1() { (void)typeid(NP((void*)(id*)0)); } 13f4a2713aSLionel Sambuc 14f4a2713aSLionel Sambucclass Poly { virtual ~Poly(); }; 15f4a2713aSLionel SambucPoly& P(void*); 16*0a6a1f1dSLionel Sambucvoid 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