FSF GCC merge 02/23/03
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.bugs / 900428_02.C
blob9da709fdc8199ac27150ad8f97cf5567acb024d5
1 // g++ 1.37.1 bug 900428_02
3 // g++ fails to issue either errors or warnings (even with -pedantic) for
4 // attempts to perform either pre or post increment or decrement operations
5 // on variables which have either pointer-to-void types or pointer-to-function
6 // types.
8 // cfront 2.0 passes this test.
10 // keywords: pointer arithmetic, increment, decrement
11 // Build don't link:
13 void *vp;
14 void (*fp) ();
16 void test ()
18   vp++;         /* ERROR - */
19   ++vp;         /* ERROR - */
20   vp--;         /* ERROR - */
21   --vp;         /* ERROR - */
23   fp++;         /* ERROR - */
24   ++fp;         /* ERROR - */
25   fp--;         /* ERROR - */
26   --fp;         /* ERROR - */