OSDN Git Service

PR middle-end/20256
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / comp-return-1.c
1 /* When merging a nonprototype definition of a function with a prior
2    prototype declaration, the composite type of the return types must
3    be formed rather than just copying the function type.  */
4 /* Origin: Joseph Myers <jsm@polyomino.org.uk> */
5 /* { dg-do compile } */
6
7 typedef int a[];
8 typedef int a5[5];
9 typedef int a10[10];
10
11 a *f1 ();
12 a5 *f1 () { return 0; }
13
14 a *f2 (void);
15 a5 *f2 () { return 0; }
16
17 a *f3 ();
18 a5 *f3 (void) { return 0; }
19
20 a *f4 (void);
21 a5 *f4 (void) { return 0; }
22
23 void
24 g (void)
25 {
26   a10 *x;
27   x = f1 (); /* { dg-error "incompatible" "f1" } */
28   x = f2 (); /* { dg-error "incompatible" "f2" } */
29   x = f3 (); /* { dg-error "incompatible" "f3" } */
30   x = f4 (); /* { dg-error "incompatible" "f4" } */
31 }