Home | History | Annotate | Download | only in SemaObjC
      1 // RUN: %clang_cc1 -fsyntax-only -verify %s
      2 // rdar://8191774
      3 
      4 @protocol SomeProtocol
      5 @end
      6 
      7 @protocol SomeProtocol1
      8 @end
      9 
     10 @interface SomeObject <SomeProtocol>
     11 @end
     12 
     13 int main () {
     14     Class <SomeProtocol> classA;
     15     Class <SomeProtocol> classB;
     16     Class <SomeProtocol, SomeProtocol1> classC;
     17     Class <SomeProtocol1> classD;
     18     void * pv = 0;
     19     Class c = (Class)0;;
     20     if (pv)
     21       return classA == pv;
     22 
     23     if (c)
     24       return classA == c;
     25     
     26     return classA == classB  || classA == classC ||
     27            classC == classA ||
     28            classA == classD; // expected-warning {{comparison of distinct pointer types ('Class<SomeProtocol> *' and 'Class<SomeProtocol1> *')}}
     29 }
     30 
     31