================ @@ -52,3 +52,37 @@ void constant_id_string(unsigned idx) { unsafe_char = ""[1]; //expected-warning{{unsafe buffer access}} unsafe_char = ""[idx]; //expected-warning{{unsafe buffer access}} } + +typedef float Float4x4[4][4]; + +// expected-warning@+1 {{'matrix' is an unsafe buffer that does not perform bounds checks}} +float two_dimension_array(Float4x4& matrix) { + // expected-note@+1{{used in buffer access here}} + float a = matrix[0][4]; ---------------- jkorous-apple wrote:
In the future we should just immediately emit an error for this case. Can we change the test to use a variable instead of out-of-bounds constant? https://github.com/llvm/llvm-project/pull/118249 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits