summaryrefslogtreecommitdiffstats
path: root/test/Analysis/new.cpp
blob: f26eecd4b196a9a39946109f946118547371a961 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// RUN: %clang_cc1 -analyze -analyzer-check-objc-mem -analyzer-store region -verify %s

void f1() {
  int *n = new int;
  if (*n) { // expected-warning {{Branch condition evaluates to a garbage value}}
  }
}

void f2() {
  int *n = new int(3);
  if (*n) { // no-warning
  }
}

OpenPOWER on IntegriCloud