aboutsummaryrefslogtreecommitdiff
path: root/test/CXX/expr/expr.prim/expr.prim.lambda/blocks.cpp
blob: 2ed738d3fd18fb3ed780c96377ac587639a8547b (plain)
1
2
3
4
5
6
7
8
9
10
// RUN: %clang_cc1 -std=c++11 -fblocks %s -verify

void block_capture_errors() {
  __block int var; // expected-note 2{{'var' declared here}}
  (void)[var] { }; // expected-error{{__block variable 'var' cannot be captured in a lambda}} \
  // expected-error{{lambda expressions are not supported yet}}

  (void)[=] { var = 17; }; // expected-error{{__block variable 'var' cannot be captured in a lambda}} \
  // expected-error{{lambda expressions are not supported yet}}
}