================
@@ -0,0 +1,9 @@
+// RUN: %clang_cc1 -fsyntax-only -verify %s
+
+void func(int n) {
+ int grp[n][n];
+ int (*ptr)[n];
+
+ for (int i = 0; i < n; i++)
+ ptr = &grp[i]; // expected-error {{incompatible assignment of pointers
of variable-length array type 'int (*)[n]'; consider using a typedef to use the
same variable-length array type for both operands}}
+}
----------------
AaronBallman wrote:
It's basically a holdover from UNIX; files were a series of lines which ended
with a newline character, so no newline at the end of the source file can trip
up some tools (I think most tools these days handle everything reasonably well,
though).
https://github.com/llvm/llvm-project/pull/101261
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits