用于进行gcc测试

源代码在线查看: method-1.mm

软件大小: 6330 K
上传用户: yhw002
关键词: gcc 测试
下载地址: 免注册下载 普通下载 VIP

相关代码

				/* Test whether casting 'id' to a specific class removes method lookup				   ambiguity.  */				/* Author: Ziemowit Laski .  */								/* { dg-do compile } */								#include 								@class Int1, Int2;								@interface Int1				+ (Int1 *)classMethod1;				+ (id)classMethod2;				- (Int1 *)instanceMethod:(Int2 *)arg;  /* { dg-bogus "using" } */				@end								@interface Int2: Int1				+ (Int1 *)classMethod1; 				+ (id)classMethod2;				- (id)int2Method;				- (int)instanceMethod:(int)arg;  /* { dg-bogus "also found" } */				@end								int main(void) {				  id i = [(Int2 *)[Int1 classMethod1] int2Method];   /* { dg-bogus "may not respond to" } */				  int j = [(Int2 *)[Int2 classMethod2] instanceMethod: 45];  /* { dg-bogus "multiple methods" } */					/* { dg-bogus "invalid conversion" "" { target *-*-* } 25 } */					/* { dg-bogus "invalid conversion" "" { target *-*-* } 25 } */				  return j;				}							

相关资源