Commit 88afb6e
committed
[flang] Semantic checks for bad usage of whole assumed-size arrays
The semantics pass currently checks for several constraints
that apply to the use of whole assumed-size arrays in various
contexts, but C1002 wasn't really implemented. This patch
implements C1002 by disallowing the use of whole assumed-size
arrays in expressions and variables unless specifically
allowed by the context. This centralizes the error reporting,
which has been improved with a link to the array's declaration.
Differential revision: https://reviews.llvm.org/D886911 parent 940d7aa commit 88afb6e
File tree
6 files changed
+51
-37
lines changed- flang
- include/flang/Semantics
- lib/Semantics
- test/Semantics
6 files changed
+51
-37
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| |||
139 | 140 | | |
140 | 141 | | |
141 | 142 | | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
142 | 149 | | |
143 | 150 | | |
144 | 151 | | |
| |||
372 | 379 | | |
373 | 380 | | |
374 | 381 | | |
| 382 | + | |
375 | 383 | | |
376 | 384 | | |
377 | 385 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | 69 | | |
75 | 70 | | |
76 | 71 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
298 | 298 | | |
299 | 299 | | |
300 | 300 | | |
301 | | - | |
302 | | - | |
303 | | - | |
304 | | - | |
305 | | - | |
306 | | - | |
307 | | - | |
308 | | - | |
309 | 301 | | |
310 | 302 | | |
311 | 303 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
| 154 | + | |
154 | 155 | | |
155 | 156 | | |
156 | 157 | | |
| |||
673 | 674 | | |
674 | 675 | | |
675 | 676 | | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
676 | 685 | | |
677 | 686 | | |
678 | 687 | | |
| |||
885 | 894 | | |
886 | 895 | | |
887 | 896 | | |
888 | | - | |
| 897 | + | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
889 | 903 | | |
890 | 904 | | |
891 | 905 | | |
| |||
2713 | 2727 | | |
2714 | 2728 | | |
2715 | 2729 | | |
2716 | | - | |
2717 | | - | |
2718 | | - | |
2719 | 2730 | | |
2720 | 2731 | | |
2721 | 2732 | | |
| |||
2983 | 2994 | | |
2984 | 2995 | | |
2985 | 2996 | | |
| 2997 | + | |
2986 | 2998 | | |
2987 | 2999 | | |
2988 | 3000 | | |
2989 | 3001 | | |
2990 | 3002 | | |
2991 | 3003 | | |
2992 | 3004 | | |
2993 | | - | |
2994 | | - | |
2995 | | - | |
2996 | | - | |
2997 | 3005 | | |
2998 | | - | |
2999 | | - | |
3000 | | - | |
3001 | | - | |
3002 | | - | |
3003 | | - | |
3004 | | - | |
3005 | | - | |
3006 | | - | |
3007 | | - | |
| 3006 | + | |
| 3007 | + | |
| 3008 | + | |
| 3009 | + | |
| 3010 | + | |
| 3011 | + | |
| 3012 | + | |
| 3013 | + | |
| 3014 | + | |
| 3015 | + | |
| 3016 | + | |
| 3017 | + | |
| 3018 | + | |
| 3019 | + | |
| 3020 | + | |
| 3021 | + | |
| 3022 | + | |
| 3023 | + | |
| 3024 | + | |
| 3025 | + | |
| 3026 | + | |
| 3027 | + | |
| 3028 | + | |
3008 | 3029 | | |
3009 | | - | |
3010 | | - | |
3011 | | - | |
3012 | 3030 | | |
| 3031 | + | |
3013 | 3032 | | |
3014 | 3033 | | |
3015 | 3034 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
97 | | - | |
| 97 | + | |
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
| |||
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
109 | | - | |
| 109 | + | |
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
178 | 178 | | |
179 | 179 | | |
180 | 180 | | |
181 | | - | |
| 181 | + | |
182 | 182 | | |
183 | 183 | | |
0 commit comments