OSDN Git Service

* gcc.dg/debug/dwarf2/aranges-fnsec-1.c: Add -w to dg-options.
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / decl-1.c
1 /* Copyright (C) 2002 Free Software Foundation, Inc.
2
3    Source: Neil Booth, 12 Feb 2002.
4
5    In the declaration of proc, x must be parsed as a typedef name (C99
6    6.7.5.3 p11.  Also see C89 DR #009, which was erroneously ommitted
7    from C99, and resubmitted as DR #249: if in a parameter
8    declaration, an identifier can be read as a typedef name or a
9    paramter name, it is read as a typedef name).  */
10
11 /* { dg-do compile } */
12
13 typedef int x;
14 typedef int y;
15 int proc(int (x));      /* x is a typedef, param to proc is a function.  */
16 int proc2(int x);       /* x is an identifier, param is an int.  */
17
18 /* Parameter to proc3 is unnamed, with type a function that returns
19    int and takes a single argument of type function with one int
20    parameter returning int.  In particular, proc3 is not a function
21    that takes a parameter y that is a function with one int parameter
22    returning int.  8-)  */
23 int proc3(int (y (x)));
24
25 int main ()
26 {
27   proc (proc2);         /* { dg-bogus "integer from pointer" } */
28   return proc3 (proc);  /* { dg-bogus "incompatible pointer type" } */
29 }