aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Sema/MultiplexExternalSemaSource.cpp
diff options
context:
space:
mode:
authorIsmail Pazarbasi <ismail.pazarbasi@gmail.com>2015-05-18 19:59:11 +0000
committerIsmail Pazarbasi <ismail.pazarbasi@gmail.com>2015-05-18 19:59:11 +0000
commite5768d1717a354531f00062fdaf5d1dfbbedf12b (patch)
tree22c0dc5782308e6e284428b877eff0e386fb3f6a /clang/lib/Sema/MultiplexExternalSemaSource.cpp
parent1d4911bc994789169594be634ae158966fc41cfb (diff)
downloadllvm-e5768d1717a354531f00062fdaf5d1dfbbedf12b.zip
llvm-e5768d1717a354531f00062fdaf5d1dfbbedf12b.tar.gz
llvm-e5768d1717a354531f00062fdaf5d1dfbbedf12b.tar.bz2
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
Diffstat (limited to 'clang/lib/Sema/MultiplexExternalSemaSource.cpp')
-rw-r--r--clang/lib/Sema/MultiplexExternalSemaSource.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/clang/lib/Sema/MultiplexExternalSemaSource.cpp b/clang/lib/Sema/MultiplexExternalSemaSource.cpp
index 51a1274..9ecb5a7 100644
--- a/clang/lib/Sema/MultiplexExternalSemaSource.cpp
+++ b/clang/lib/Sema/MultiplexExternalSemaSource.cpp
@@ -212,7 +212,15 @@ void MultiplexExternalSemaSource::ReadUndefinedButUsed(
for(size_t i = 0; i < Sources.size(); ++i)
Sources[i]->ReadUndefinedButUsed(Undefined);
}
-
+
+void MultiplexExternalSemaSource::ReadMismatchingDeleteExpressions(
+ llvm::MapVector<FieldDecl *,
+ llvm::SmallVector<std::pair<SourceLocation, bool>, 4>> &
+ Exprs) {
+ for (auto &Source : Sources)
+ Source->ReadMismatchingDeleteExpressions(Exprs);
+}
+
bool MultiplexExternalSemaSource::LookupUnqualified(LookupResult &R, Scope *S){
for(size_t i = 0; i < Sources.size(); ++i)
Sources[i]->LookupUnqualified(R, S);