URL
https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk
Subversion Repositories openrisc_me
[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.2.2/] [gcc/] [testsuite/] [obj-c++.dg/] [proto-lossage-3.mm] - Rev 154
Compare with Previous | Blame | View Log
/* Crash due to descriptionFor(Instance|Class)Method applied to
a protocol with no instance/class methods respectively.
Problem report and original fix by richard@brainstorm.co.uk. */
/* { dg-do run } */
#include <objc/objc.h>
#include <objc/Object.h>
#include <objc/Protocol.h>
@protocol NoInstanceMethods
+ testMethod;
@end
@protocol NoClassMethods
- testMethod;
@end
int
main()
{
[@protocol(NoInstanceMethods) descriptionForInstanceMethod: @selector(name)];
[@protocol(NoInstanceMethods) descriptionForClassMethod: @selector(name)];
[@protocol(NoClassMethods) descriptionForInstanceMethod: @selector(name)];
[@protocol(NoClassMethods) descriptionForClassMethod: @selector(name)];
return 0;
}