YouCompleteMe/cpp/llvm/tools/clang/test/SemaObjC/compare-qualified-class.m
Strahinja Val Markovic 1f51a89d39 Adding more llvm/clang files
These were ignored by git accidentally. We want ALL OF THEM since they all came
in the llvm/clang source distribution.
2012-07-05 17:55:45 -07:00

31 lines
684 B
Objective-C

// RUN: %clang_cc1 -fsyntax-only -verify %s
// rdar://8191774
@protocol SomeProtocol
@end
@protocol SomeProtocol1
@end
@interface SomeObject <SomeProtocol>
@end
int main () {
Class <SomeProtocol> classA;
Class <SomeProtocol> classB;
Class <SomeProtocol, SomeProtocol1> classC;
Class <SomeProtocol1> classD;
void * pv = 0;
Class c = (Class)0;;
if (pv)
return classA == pv;
if (c)
return classA == c;
return classA == classB || classA == classC ||
classC == classA ||
classA == classD; // expected-warning {{comparison of distinct pointer types ('Class<SomeProtocol> *' and 'Class<SomeProtocol1> *')}}
}