aboutsummaryrefslogtreecommitdiff
path: root/test/Analysis/cxx-crashes.cpp
blob: db2298df8917ab39da667afcd417197297f570e0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// RUN: %clang_cc1 -analyze -analyzer-check-objc-mem -verify %s

int f1(char *dst) {
  char *p = dst + 4;
  char *q = dst + 3;
  return !(q >= p);
}

namespace {

struct A { };
struct B {
  operator A();
};

A f(char *dst) {
  B b;
  return b;
}

}