OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [g++.old-deja/] [g++.bugs/] [900321_01.C] - Blame information for rev 841

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
// { dg-do assemble  }
2
// g++ 1.37.1 bug 900321_01
3
 
4
// cfront flags ERRORs on each of the lines indicated below. g++ does not
5
// flag either ERRORs or warnings.
6
 
7
// Although I cannot find where in the current C++ Reference Manual this
8
// topic is covered, I am sure that these statements should get ERRORs in
9
// a "strongly typed" language.
10
 
11
// Cfront 2.0 passes this test.
12
 
13
// keywords: array types, array bound, pointers
14
 
15
int (*ptr_to_array_of_ints)[];
16
int (*ptr_to_array_of_3_ints) [3];
17
int (*ptr_to_array_of_5_ints) [5];
18
 
19
void function_0 ()
20
{
21
  // we miss the first two because typeck.c (comp_array_types) deems
22
  // it okay if one of the sizes is null
23
  ptr_to_array_of_ints = ptr_to_array_of_3_ints;        // { dg-error "" }
24
  ptr_to_array_of_3_ints = ptr_to_array_of_ints;        // { dg-error "" }
25
 
26
  ptr_to_array_of_3_ints = ptr_to_array_of_5_ints;      // { dg-error "" }
27
  ptr_to_array_of_5_ints = ptr_to_array_of_3_ints;      // { dg-error "" }
28
}
29
 
30
int main () { return 0; }

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.