summaryrefslogtreecommitdiffstats
path: root/test/Analysis/stack-block-returned.cpp
blob: af2cec7766976de57a9aa51c32f1e4cbe471e079 (plain)
1
2
3
4
5
6
7
8
9
// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-store=region -fblocks -verify %s

typedef void (^bptr)(void);

bptr bf(int j) {
  __block int i;
  const bptr &qq = ^{ i=0; }; // expected-note {{binding reference variable 'qq' here}}
  return qq; // expected-error {{returning block that lives on the local stack}}
}