diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2010-09-13 20:15:54 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2010-09-13 20:15:54 +0000 |
commit | 4076dacf1497fb95cb298b9d964fbdbdaf9bde6c (patch) | |
tree | 5b91fb94a2e1a10ffbd30a975bebb9865c88395e /test/SemaCXX/delete.cpp | |
parent | f1b8911d35bb2830a13267581d3cbde4b6b85db6 (diff) |
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
Diffstat (limited to 'test/SemaCXX/delete.cpp')
-rw-r--r-- | test/SemaCXX/delete.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/SemaCXX/delete.cpp b/test/SemaCXX/delete.cpp new file mode 100644 index 0000000000..4567888a37 --- /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}} +} |