]> granicus.if.org Git - clang/commit
Detect uses of mismatching forms of 'new' and 'delete'
authorIsmail Pazarbasi <ismail.pazarbasi@gmail.com>
Thu, 14 May 2015 16:14:57 +0000 (16:14 +0000)
committerIsmail Pazarbasi <ismail.pazarbasi@gmail.com>
Thu, 14 May 2015 16:14:57 +0000 (16:14 +0000)
commit742dc9b6c9686ab52860b7da39c3a126d8a97fbc
treee9abe40f677627af939195478d9364f18adf9e6c
parent24f86098928f6f166d11fee6c13085575f29a8f0
Detect uses of mismatching forms of 'new' and 'delete'

Emit warning when operand to `delete` is allocated with `new[]` or
operand to `delete[]` is allocated with `new`.

Reviewers: rtrieu, jordan_rose, rsmith

Subscribers: majnemer, cfe-commits

Differential Revision: http://reviews.llvm.org/D4661

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@237368 91177308-0d34-0410-b5e6-96231b3b80d8
17 files changed:
include/clang/Basic/DiagnosticSemaKinds.td
include/clang/Sema/ExternalSemaSource.h
include/clang/Sema/MultiplexExternalSemaSource.h
include/clang/Sema/Sema.h
include/clang/Serialization/ASTBitCodes.h
include/clang/Serialization/ASTReader.h
lib/Sema/MultiplexExternalSemaSource.cpp
lib/Sema/Sema.cpp
lib/Sema/SemaExprCXX.cpp
lib/Serialization/ASTReader.cpp
lib/Serialization/ASTWriter.cpp
test/Analysis/Malloc+MismatchedDeallocator+NewDelete.cpp
test/Analysis/MismatchedDeallocator-checker-test.mm
test/Analysis/MismatchedDeallocator-path-notes.cpp
test/CodeGenCXX/new.cpp
test/SemaCXX/delete-mismatch.h [new file with mode: 0644]
test/SemaCXX/delete.cpp