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

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

  int *n2 = new int(3);
  if (*n2) { // no-warning
  }
}