HomePhabricator

Detect uses of mismatching forms of 'new' and 'delete'

Authored by ismailp on May 18 2015, 12:59 PM.

Description

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.

rev 2 update:
getNewExprFromInitListOrExpr should return dyn_cast_or_null
instead of dyn_cast, since E might be null.

Reviewers: rtrieu, jordan_rose, rsmith

Subscribers: majnemer, cfe-commits

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

llvm-svn: 237608

Details

Committed
ismailpMay 18 2015, 12:59 PM
Differential Revision
D4661: Detect mismatching 'new' and 'delete' uses
Parents
rG1d4911bc9947: Have -Wredundant-move ignore reference types.
Branches
Unknown
Tags
Unknown