File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -451,20 +451,20 @@ struct S {
451451};
452452void aggregate_struct () {
453453 S s;
454- new (&s) S{1 };
455- clang_analyzer_eval (1 == s. x ); // expected-warning{{TRUE}}
454+ S *s_ptr = new (&s) S{1 };
455+ clang_analyzer_eval (1 == s_ptr-> x ); // expected-warning{{TRUE}}
456456
457457 S vi;
458- new (&vi) S{};
459- clang_analyzer_eval (0 == vi. x ); // expected-warning{{TRUE}}
458+ S *vi_ptr = new (&vi) S{};
459+ clang_analyzer_eval (0 == vi_ptr-> x ); // expected-warning{{TRUE}}
460460
461461 S di;
462- new (&di) S;
463- int z = di. x + 1 ; // expected-warning{{The left operand of '+' is a garbage value}}
462+ S *di_ptr = new (&di) S;
463+ int z = di_ptr-> x + 1 ; // expected-warning{{The left operand of '+' is a garbage value}}
464464}
465465void initialize_non_zeroth_element (S arr[2 ]) {
466- new (&arr[1 ]) S{1 };
467- clang_analyzer_eval (1 == arr[ 1 ]. x ); // expected-warning{{TRUE}}
466+ S *s = new (&arr[1 ]) S{1 };
467+ clang_analyzer_eval (1 == s-> x ); // expected-warning{{TRUE}}
468468}
469469void initialize_non_zeroth_argument_pointers (S *arr[2 ]) {
470470 arr[1 ] = new (arr[1 ]) S{1 };
You can’t perform that action at this time.
0 commit comments