Lines Matching +full:r +full:- +full:- +full:p
1 // RUN: %clang_cc1 -std=c++20 -Wunsafe-buffer-usage -fsafe-buffer-usage-suggestions -verify %s
9 …int* p = new int[10]; // expected-warning{{'p' is an unsafe pointer used for buffer access}} expec… in local_assign_both_span() local
10 tmp = p[4]; // expected-note{{used in buffer access here}} in local_assign_both_span()
12 …-warning{{'q' is an unsafe pointer used for buffer access}} expected-note{{change type of 'q' to '… in local_assign_both_span()
13 tmp = q[4]; // expected-note{{used in buffer access here}} in local_assign_both_span()
15 q = p; in local_assign_both_span()
20 int* p = new int[10]; in local_assign_rhs_span() local
21 int* q = new int[10]; // expected-warning{{'q' is an unsafe pointer used for buffer access}} in local_assign_rhs_span()
22 tmp = q[4]; // expected-note{{used in buffer access here}} in local_assign_rhs_span()
23 p = q; // FIXME: we do not fix `p = q` here as the `.data()` fix-it is not generally correct in local_assign_rhs_span()
28 int* p = new int[10]; in local_assign_no_span() local
30 p = q; in local_assign_no_span()
35 …int* p = new int[10]; // expected-warning{{'p' is an unsafe pointer used for buffer access}} expe… in local_assign_lhs_span() local
36 tmp = p[4]; // expected-note{{used in buffer access here}} in local_assign_lhs_span()
39 p = q; in local_assign_lhs_span()
46 …int *d = c; // expected-warning{{'d' is an unsafe pointer used for buffer access}} expected-note{… in lhs_span_multi_assign()
47 int tmp = d[2]; // expected-note{{used in buffer access here}} in lhs_span_multi_assign()
52 int *y; // expected-warning{{'y' is an unsafe pointer used for buffer access}} in rhs_span()
53 y[5] = 10; // expected-note{{used in buffer access here}} in rhs_span()
55 x = y; // FIXME: we do not fix `x = y` here as the `.data()` fix-it is not generally correct in rhs_span()
60 …p = q; // expected-warning{{'p' is an unsafe pointer used for buffer access}} expected-note{{chan… in rhs_span1() local
61 p[5] = 10; // expected-note{{used in buffer access here}} in rhs_span1()
62 …r = q; // expected-warning{{'r' is an unsafe pointer used for buffer access}} expected-note{{chan… in rhs_span1() local
63 r[10] = 5; // expected-note{{used in buffer access here}} in rhs_span1()
68 int *p = q; // expected-warning{{'p' is an unsafe pointer used for buffer access}} in rhs_span2() local
69 p[5] = 10; // expected-note{{used in buffer access here}} in rhs_span2()
70 …int *r = q; // FIXME: we do not fix `int *r = q` here as the `.data()` fix-it is not generally cor… in rhs_span2() local
76 int *y = new int[10]; // expected-warning{{'y' is an unsafe pointer used for buffer access}} in test_grouping()
77 tmp = y[5]; // expected-note{{used in buffer access here}} in test_grouping()
80 x = y; // FIXME: we do not fix `x = y` here as the `.data()` fix-it is not generally correct in test_grouping()
87 int *y = new int[10]; // expected-warning{{'y' is an unsafe pointer used for buffer access}} in test_grouping1()
88 tmp = y[5]; // expected-note{{used in buffer access here}} in test_grouping1()
90 x = y; // FIXME: we do not fix `x = y` here as the `.data()` fix-it is not generally correct in test_grouping1()
92 int *w = new int[10]; // expected-warning{{'w' is an unsafe pointer used for buffer access}} in test_grouping1()
93 tmp = w[5]; // expected-note{{used in buffer access here}} in test_grouping1()
95 z = w; // FIXME: we do not fix `z = w` here as the `.data()` fix-it is not generally correct in test_grouping1()
99 int *r = new int[7]; in foo1a() local
100 int *p = new int[4]; // expected-warning{{'p' is an unsafe pointer used for buffer access}} in foo1a() local
101 p = r; in foo1a()
102 int tmp = p[9]; // expected-note{{used in buffer access here}} in foo1a()
104 q = r; // FIXME: we do not fix `q = r` here as the `.data()` fix-it is not generally correct in foo1a()
108 int *r = new int[7]; in foo1b() local
109 …p = new int[4]; // expected-warning{{'p' is an unsafe pointer used for buffer access}} expected-n… in foo1b() local
110 p = r; in foo1b()
111 int tmp = p[9]; // expected-note{{used in buffer access here}} in foo1b()
112 …-warning{{'q' is an unsafe pointer used for buffer access}} expected-note{{change type of 'q' to '… in foo1b()
113 q = r; in foo1b()
114 tmp = q[9]; // expected-note{{used in buffer access here}} in foo1b()
118 int *r = new int[7]; // expected-warning{{'r' is an unsafe pointer used for buffer access}} in foo1c() local
119 int *p = new int[4]; in foo1c() local
120 p = r; // FIXME: we do not fix `p = r` here as the `.data()` fix-it is not generally correct in foo1c()
121 int tmp = r[9]; // expected-note{{used in buffer access here}} in foo1c()
122 int *q; // expected-warning{{'q' is an unsafe pointer used for buffer access}} in foo1c()
123 q = r; // FIXME: we do not fix `q = r` here as the `.data()` fix-it is not generally correct in foo1c()
124 tmp = q[9]; // expected-note{{used in buffer access here}} in foo1c()
128 int *r = new int[7]; in foo2a() local
129 …p = new int[5]; // expected-warning{{'p' is an unsafe pointer used for buffer access}} expected-n… in foo2a() local
131 p = q; in foo2a()
132 int tmp = p[8]; // expected-note{{used in buffer access here}} in foo2a()
133 q = r; in foo2a()
137 int *r = new int[7]; in foo2b() local
138 int *p = new int[5]; in foo2b() local
139 int *q = new int[4]; // expected-warning{{'q' is an unsafe pointer used for buffer access}} in foo2b()
140 …p = q; // FIXME: we do not fix `p = q` here as the `.data()` fix-it is not generally cor… in foo2b()
141 int tmp = q[8]; // expected-note{{used in buffer access here}} in foo2b()
142 q = r; in foo2b()
146 int *r = new int[7]; in foo2c() local
147 …p = new int[5]; // expected-warning{{'p' is an unsafe pointer used for buffer access}} expected-n… in foo2c() local
148 …-warning{{'q' is an unsafe pointer used for buffer access}} expected-note{{change type of 'q' to '… in foo2c()
149 p = q; in foo2c()
150 int tmp = p[8]; // expected-note{{used in buffer access here}} in foo2c()
151 q = r; in foo2c()
152 tmp = q[8]; // expected-note{{used in buffer access here}} in foo2c()
156 int *r = new int[7]; in foo3a() local
157 int *p = new int[5]; // expected-warning{{'p' is an unsafe pointer used for buffer access}} in foo3a() local
159 …q = p; // FIXME: we do not fix `q = p` here as the `.data()` fix-it is not generally cor… in foo3a()
160 int tmp = p[8]; // expected-note{{used in buffer access here}} in foo3a()
161 q = r; in foo3a()
165 int *r = new int[7]; in foo3b() local
166 int *p = new int[5]; in foo3b() local
167 …-warning{{'q' is an unsafe pointer used for buffer access}} //expected-note{{change type of 'q' to… in foo3b()
168 q = p; in foo3b()
169 int tmp = q[8]; // expected-note{{used in buffer access here}} in foo3b()
170 q = r; in foo3b()
174 int *r = new int[8]; in test_crash() local
175 int *q = r; in test_crash()
176 …p; // expected-warning{{'p' is an unsafe pointer used for buffer access}} expected-note{{change t… in test_crash() local
177 p = q; in test_crash()
178 int tmp = p[9]; // expected-note{{used in buffer access here}} in test_crash()
183 int *local; // expected-warning{{'local' is an unsafe pointer used for buffer access}} in foo_uuc()
185 local++; // expected-note{{used in pointer arithmetic here}} in foo_uuc()
187 (local = ptr) += 5; // expected-warning{{unsafe pointer arithmetic}} in foo_uuc()
191 …int *r = new int[8]; // expected-warning{{'r' is an unsafe pointer used for buffer access}} // e… in check_rhs_fix() local
193 r[7] = 9; // expected-note{{used in buffer access here}} in check_rhs_fix()
194 r = x; in check_rhs_fix()
198 int *r = new int[8]; // expected-warning{{'r' is an unsafe pointer used for buffer access}} in check_rhs_nofix() local
199 int *x; // expected-warning{{'x' is an unsafe pointer used for buffer access}} in check_rhs_nofix()
200 r[7] = 9; // expected-note{{used in buffer access here}} in check_rhs_nofix()
201 r = x; in check_rhs_nofix()
202 x++; // expected-note{{used in pointer arithmetic here}} in check_rhs_nofix()
206 int *r = new int[8]; // expected-warning{{'r' is an unsafe pointer used for buffer access}} in check_rhs_nofix_order() local
207 int *x; // expected-warning{{'x' is an unsafe pointer used for buffer access}} in check_rhs_nofix_order()
208 x++; // expected-note{{used in pointer arithmetic here}} in check_rhs_nofix_order()
209 r[7] = 9; // expected-note{{used in buffer access here}} in check_rhs_nofix_order()
210 r = x; in check_rhs_nofix_order()
214 int *r = new int[8]; // expected-warning{{'r' is an unsafe pointer used for buffer access}} in check_rhs_nofix_order1() local
215 r[7] = 9; // expected-note{{used in buffer access here}} in check_rhs_nofix_order1()
216 int *x; // expected-warning{{'x' is an unsafe pointer used for buffer access}} in check_rhs_nofix_order1()
217 x++; // expected-note{{used in pointer arithmetic here}} in check_rhs_nofix_order1()
218 r = x; in check_rhs_nofix_order1()
222 int *x; // expected-warning{{'x' is an unsafe pointer used for buffer access}} in check_rhs_nofix_order2()
223 int *r = new int[8]; // expected-warning{{'r' is an unsafe pointer used for buffer access}} in check_rhs_nofix_order2() local
224 r[7] = 9; // expected-note{{used in buffer access here}} in check_rhs_nofix_order2()
225 x++; // expected-note{{used in pointer arithmetic here}} in check_rhs_nofix_order2()
226 r = x; in check_rhs_nofix_order2()
230 int *x; // expected-warning{{'x' is an unsafe pointer used for buffer access}} in check_rhs_nofix_order3()
231 int *r = new int[8]; // expected-warning{{'r' is an unsafe pointer used for buffer access}} in check_rhs_nofix_order3() local
232 r = x; in check_rhs_nofix_order3()
233 r[7] = 9; // expected-note{{used in buffer access here}} in check_rhs_nofix_order3()
234 x++; // expected-note{{used in pointer arithmetic here}} in check_rhs_nofix_order3()
238 int *x; // expected-warning{{'x' is an unsafe pointer used for buffer access}} in check_rhs_nofix_order4()
239 int *r = new int[8]; // expected-warning{{'r' is an unsafe pointer used for buffer access}} in check_rhs_nofix_order4() local
240 r[7] = 9; // expected-note{{used in buffer access here}} in check_rhs_nofix_order4()
241 r = x; in check_rhs_nofix_order4()
242 x++; // expected-note{{used in pointer arithmetic here}} in check_rhs_nofix_order4()
246 …int *r = new int[8]; // expected-warning{{'r' is an unsafe pointer used for buffer access}} // e… in no_unhandled_lhs() local
247 r[7] = 9; // expected-note{{used in buffer access here}} in no_unhandled_lhs()
249 r = x; in no_unhandled_lhs()
253 int *r = new int[8]; // expected-warning{{'r' is an unsafe pointer used for buffer access}} in unhandled_lhs() local
254 r[7] = 9; // expected-note{{used in buffer access here}} in unhandled_lhs()
256 r = x; in unhandled_lhs()
257 return typeid(*r); in unhandled_lhs()
261 int *r = new int[8]; // expected-warning{{'r' is an unsafe pointer used for buffer access}} in unhandled_rhs() local
262 r[7] = 9; // expected-note{{used in buffer access here}} in unhandled_rhs()
264 r = x; in unhandled_rhs()
269 int *x = new int[4]; // expected-warning{{'x' is an unsafe pointer used for buffer access}} in test_negative_index()
270 int *p; // expected-warning{{'p' is an unsafe pointer used for buffer access}} in test_negative_index() local
271 p = &x[1]; // expected-note{{used in buffer access here}} in test_negative_index()
272 p[-1] = 9; // expected-note{{used in buffer access here}} in test_negative_index()
276 int *r = new int[8]; // expected-warning{{'r' is an unsafe pointer used for buffer access}} in test_unfixable() local
277 int *x; // expected-warning{{'x' is an unsafe pointer used for buffer access}} in test_unfixable()
278 x[7] = 9; // expected-note{{used in buffer access here}} in test_unfixable()
279 r = x; in test_unfixable()
280 r++; // expected-note{{used in pointer arithmetic here}} in test_unfixable()
284 …r = new int[10]; // expected-warning{{'r' is an unsafe pointer used for buffer access}} expected… in test_cyclic_deps() local
286 q = r; in test_cyclic_deps()
287 int *p; in test_cyclic_deps() local
288 p = q; in test_cyclic_deps()
289 r[3] = 9; // expected-note{{used in buffer access here}} in test_cyclic_deps()
290 r = p; in test_cyclic_deps()
294 int *r = new int[10]; // expected-warning{{'r' is an unsafe pointer used for buffer access}} in test_cyclic_deps_a() local
296 q = r; in test_cyclic_deps_a()
297 int *p; // expected-warning{{'p' is an unsafe pointer used for buffer access}} in test_cyclic_deps_a() local
298 p = q; in test_cyclic_deps_a()
299 r[3] = 9; // expected-note{{used in buffer access here}} in test_cyclic_deps_a()
300 r = p; in test_cyclic_deps_a()
301 p++; // expected-note{{used in pointer arithmetic here}} in test_cyclic_deps_a()
305 int *r = new int[10]; in test_cyclic_deps1() local
307 q = r; in test_cyclic_deps1()
308 …p; // expected-warning{{'p' is an unsafe pointer used for buffer access}} expected-note{{change … in test_cyclic_deps1() local
309 p = q; in test_cyclic_deps1()
310 p[3] = 9; // expected-note{{used in buffer access here}} in test_cyclic_deps1()
311 r = p; in test_cyclic_deps1()
315 int *r = new int[10]; in test_cyclic_deps2() local
316 …-warning{{'q' is an unsafe pointer used for buffer access}} expected-note{{change type of 'q' to … in test_cyclic_deps2()
317 q = r; in test_cyclic_deps2()
318 int *p; in test_cyclic_deps2() local
319 p = q; in test_cyclic_deps2()
320 q[3] = 9; // expected-note{{used in buffer access here}} in test_cyclic_deps2()
321 r = p; in test_cyclic_deps2()
325 int *r = new int[10]; in test_cyclic_deps3() local
326 …-warning{{'q' is an unsafe pointer used for buffer access}} expected-note{{change type of 'q' to … in test_cyclic_deps3()
327 q = r; in test_cyclic_deps3()
328 …p; // expected-warning{{'p' is an unsafe pointer used for buffer access}} expected-note{{change … in test_cyclic_deps3() local
329 p = q; in test_cyclic_deps3()
330 q[3] = 9; // expected-note{{used in buffer access here}} in test_cyclic_deps3()
331 p[4] = 7; // expected-note{{used in buffer access here}} in test_cyclic_deps3()
332 r = p; in test_cyclic_deps3()
336 …r = new int[10]; // expected-warning{{'r' is an unsafe pointer used for buffer access}} expected… in test_cyclic_deps4() local
337 …-warning{{'q' is an unsafe pointer used for buffer access}} expected-note{{change type of 'q' to … in test_cyclic_deps4()
338 q = r; in test_cyclic_deps4()
339 …p; // expected-warning{{'p' is an unsafe pointer used for buffer access}} expected-note{{change … in test_cyclic_deps4() local
340 p = q; in test_cyclic_deps4()
341 q[3] = 9; // expected-note{{used in buffer access here}} in test_cyclic_deps4()
342 p[4] = 7; // expected-note{{used in buffer access here}} in test_cyclic_deps4()
343 r[1] = 5; // expected-note{{used in buffer access here}} in test_cyclic_deps4()
344 r = p; in test_cyclic_deps4()