We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e14945b commit c21d6cfCopy full SHA for c21d6cf
clang/test/Analysis/initializer.cpp
@@ -462,6 +462,14 @@ void aggregate_struct() {
462
::new (&di) S;
463
int z = di.x + 1; // expected-warning{{The left operand of '+' is a garbage value}}
464
}
465
+void initialize_non_zeroth_element(S arr[2]) {
466
+ new (&arr[1]) S{1};
467
+ clang_analyzer_eval(1 == arr[1].x); // expected-warning{{TRUE}}
468
+}
469
+void initialize_non_zeroth_argument_pointers(S *arr[2]) {
470
+ arr[1] = new (arr[1]) S{1};
471
+ clang_analyzer_eval(1 == arr[1]->x); // expected-warning{{TRUE}}
472
473
} // namespace initializer_list_arg
474
475
namespace CXX17_transparent_init_list_exprs {
0 commit comments