OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [obj-c++.dg/] [protocol-qualifier-1.mm] - Blame information for rev 703

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 703 jeremybenn
/* Contributed by Nicola Pero , November 2010.  */
2
/* { dg-do compile } */
3
 
4
/* Test that protocol qualifiers work in the same way with @class and @interface.  */
5
 
6
#include 
7
 
8
@protocol MyProtocol
9
- (void) method;
10
@end
11
 
12
 
13
/* This first snippet gives no warnings, which is correct as 'object'
14
   implements  and hence responds to 'method'.  Note how
15
   the details of the class 'MyClass' are never used.  */
16
@interface MyClass
17
@end
18
 
19
void test (MyClass  *object)
20
{
21
  [object method];
22
}
23
 
24
 
25
/* This second snippet should behave identically.  'object' still implements
26
   the same protocol and responds to 'method'.  The details of MyClass or
27
   MyClass2 are irrelevant.  */
28
@class MyClass2;
29
 
30
void test2 (MyClass2  *object)
31
{
32
  [object method];
33
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.