blob: ba2b70e4c3de53c200414492f150ae088a651480 [file] [log] [blame]
Douglas Gregor0e8ff392012-02-01 00:09:55 +00001// RUN: %clang_cc1 -std=c++11 -fblocks %s -verify
2
3void block_capture_errors() {
4 __block int var; // expected-note 2{{'var' declared here}}
Douglas Gregor656bc622012-02-09 08:26:42 +00005 (void)[var] { }; // expected-error{{__block variable 'var' cannot be captured in a lambda}}
Douglas Gregor0e8ff392012-02-01 00:09:55 +00006
Douglas Gregor656bc622012-02-09 08:26:42 +00007 (void)[=] { var = 17; }; // expected-error{{__block variable 'var' cannot be captured in a lambda}}
Douglas Gregor0e8ff392012-02-01 00:09:55 +00008}