aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.bugs/900428_02.C
blob: 9da709fdc8199ac27150ad8f97cf5567acb024d5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// g++ 1.37.1 bug 900428_02

// g++ fails to issue either errors or warnings (even with -pedantic) for
// attempts to perform either pre or post increment or decrement operations
// on variables which have either pointer-to-void types or pointer-to-function
// types.

// cfront 2.0 passes this test.

// keywords: pointer arithmetic, increment, decrement
// Build don't link:

void *vp;
void (*fp) ();

void test ()
{
  vp++;		/* ERROR - */
  ++vp;		/* ERROR - */
  vp--;		/* ERROR - */
  --vp;		/* ERROR - */

  fp++;		/* ERROR - */
  ++fp;		/* ERROR - */
  fp--;		/* ERROR - */
  --fp;		/* ERROR - */
}