When applying 'delete' on a pointer-to-array type match GCC and EDG behavior and treat it as 'delete[]'.
Also offer a fix-it hint adding '[]'.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113778 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/SemaCXX/delete.cpp b/test/SemaCXX/delete.cpp
new file mode 100644
index 0000000..4567888
--- /dev/null
+++ b/test/SemaCXX/delete.cpp
@@ -0,0 +1,9 @@
+// RUN: %clang_cc1 -fsyntax-only -verify %s
+// RUN: cp %s %t
+// RUN: %clang_cc1 -fixit -x c++ %t
+// RUN: FileCheck -input-file=%t %s
+
+void f(int a[10][20]) {
+ // CHECK: delete[] a;
+ delete a; // expected-warning {{'delete' applied to a pointer-to-array type}}
+}