You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
537 B
41 lines
537 B
4 months ago
|
// RUN: %clang_cc1 -fsyntax-only -verify %s
|
||
|
|
||
|
@protocol P @end
|
||
|
@interface I @end
|
||
|
|
||
|
struct X { X(); };
|
||
|
|
||
|
void test1(X x) {
|
||
|
void *cft;
|
||
|
id oct = (id)cft;
|
||
|
|
||
|
Class ccct;
|
||
|
ccct = (Class)cft;
|
||
|
|
||
|
I* iict = (I*)cft;
|
||
|
|
||
|
id<P> qid = (id<P>)cft;
|
||
|
|
||
|
I<P> *ip = (I<P>*)cft;
|
||
|
|
||
|
(id)x; // expected-error {{cannot convert 'X' to 'id' without a conversion operator}}
|
||
|
|
||
|
id *pid = (id*)ccct;
|
||
|
|
||
|
id<P> *qpid = (id<P>*)ccct;
|
||
|
|
||
|
int **pii;
|
||
|
|
||
|
ccct = (Class)pii;
|
||
|
|
||
|
qpid = (id<P>*)pii;
|
||
|
|
||
|
iict = (I*)pii;
|
||
|
|
||
|
pii = (int **)ccct;
|
||
|
|
||
|
pii = (int **)qpid;
|
||
|
|
||
|
}
|
||
|
|