Summary: This patch depends on patches D2556 and D2557.
Reviewers: klimek
Reviewed By: klimek
CC: cfe-commits, jordan_rose, krememek
Differential Revision: http://llvm-reviews.chandlerc.com/D2620
llvm-svn: 201221
E = Diags.end();
I != E; ++I) {
const ento::PathDiagnostic *PD = *I;
- StringRef CheckName(AnalyzerCheckNamePrefix);
+ SmallString<64> CheckName(AnalyzerCheckNamePrefix);
+ CheckName += PD->getCheckName();
addRanges(Context.diag(CheckName, PD->getLocation().asLocation(),
PD->getShortDescription()),
PD->path.back()->getRanges());
-// RUN: clang-tidy %s -checks='clang-analyzer-cplusplus' -- | FileCheck %s
+// RUN: clang-tidy %s -checks='clang-analyzer-' -- | FileCheck %s
+extern void *malloc(unsigned long);
+extern void free(void *);
void f() {
int *p = new int(42);
delete p;
delete p;
- // CHECK: warning: Attempt to free released memory
+ // CHECK: warning: Attempt to free released memory [clang-analyzer-cplusplus.NewDelete]
+}
+
+void g() {
+ void *q = malloc(132);
+ free(q);
+ free(q);
+ // CHECK: warning: Attempt to free released memory [clang-analyzer-unix.Malloc]
}