2014-07-11 Edward Smith-Rowland <3dw4rd@verizon.net>
[official-gcc.git] / gcc / testsuite / obj-c++.dg / duplicate-class-1.mm
blob9476533d1eace7bad2b6f2bacd614e2c909b574b
1 /* Contributed by Nicola Pero <nicola.pero@meta-innovation.com>, November 2010.  */
2 /* { dg-do compile } */
4 /* Test that a duplicated @implementation for the same class does not
5    crash the compiler.  */
7 @interface Test
9   Class isa;
11 - (int) test;
12 @end
14 @implementation Test
15 - (int) test
17   return 4;
19 @end
21 /* The most likely cause is that the programmer meant this to be a
22    category, so check what happens if we have some different methods
23    in there.  */
24 @implementation Test /* { dg-error "reimplementation of class .Test." } */
25 - (int) test2
27   return [self test];
29 @end
30 /* { dg-warning "incomplete implementation" "" { target *-*-* } 29 } */
31 /* { dg-warning "not found" "" { target *-*-* } 29 } */