comparison gcc/testsuite/g++.old-deja/g++.bugs/900322_01.C @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents 04ced10e8804
children
comparison
equal deleted inserted replaced
131:84e7813d76e9 145:1830386684a0
31 31
32 // It is also ill-formed to create an object of incomplete type. 32 // It is also ill-formed to create an object of incomplete type.
33 33
34 // keywords: incomplete types, arrays, element types 34 // keywords: incomplete types, arrays, element types
35 35
36 extern int extern_two_d [] []; // { dg-error "" } invalid declaration 36 extern int extern_two_d [] []; // { dg-error "12:declaration of .extern_two_d. as multidimensional" } invalid declaration
37 int tenative_two_d [] []; // { dg-error "" } caught by g++ 37 int tenative_two_d [] []; // { dg-error "5:declaration of .tenative_two_d. as multidimensional" } caught by g++
38 static int static_two_d [] []; // { dg-error "" } caught by g++ 38 static int static_two_d [] []; // { dg-error "12:declaration of .static_two_d. as multidimensional" } caught by g++
39 39
40 int (*pointer_to_two_d)[][]; // { dg-error "" } invalid declaration 40 int (*pointer_to_two_d)[][]; // { dg-error "7:declaration of .pointer_to_two_d. as multidimensional" } invalid declaration
41 41
42 void function_0 (int arg [] []) { // { dg-error "" } invalid declaration 42 void function_0 (int arg [] []) { // { dg-error "22:declaration of .arg. as multidimensional" } invalid declaration
43 } 43 }
44 44
45 typedef int int_one_d_type []; 45 typedef int int_one_d_type [];
46 typedef int_one_d_type int_two_d_type[];// { dg-error "" } invalid declaration 46 typedef int_one_d_type int_two_d_type[];// { dg-error "24:declaration of .int_two_d_type. as multidimensional" } invalid declaration
47 47
48 struct s; 48 struct s;
49 49
50 extern struct s extern_s_array [10]; // OK 50 extern struct s extern_s_array [10]; // OK
51 struct s tenative_s_array [10]; // { dg-error "" } object with incomplete type 51 struct s tenative_s_array [10]; // { dg-error "10:elements of array .s tenative_s_array \\\[10\\\]. have incomplete type" } object with incomplete type
52 static struct s static_s_array [10]; // { dg-error "" } object with incomplete type 52 // { dg-error "10:storage size" "" { target *-*-* } .-1 }
53 53 static struct s static_s_array [10]; // { dg-error "17:elements of array .s static_s_array \\\[10\\\]. have incomplete type" } object with incomplete type
54 // { dg-error "17:storage size" "" { target *-*-* } .-1 }
54 struct s (*pointer_to_s_array) []; // OK 55 struct s (*pointer_to_s_array) []; // OK
55 56
56 void function_1 (struct s arg []) { // OK 57 void function_1 (struct s arg []) { // OK
57 } 58 }
58 59