blob: 8f524e08245a1217c0ce9c4dc73ee35ae639d4b7 [file] [log] [blame]
Douglas Gregor53a9bdf2012-02-01 01:18:43 +00001// RUN: %clang_cc1 -std=c++11 %s -verify
2
3class X0 {
4 void explicit_capture() {
5 int foo;
6
Douglas Gregor656bc622012-02-09 08:26:42 +00007 (void)[foo, foo] () {}; // expected-error {{'foo' can appear only once}}
8 (void)[this, this] () {}; // expected-error {{'this' can appear only once}}
9 (void)[=, foo] () {}; // expected-error {{'&' must precede a capture when}}
10 (void)[=, &foo] () {};
11 (void)[=, this] () {}; // expected-error {{'this' cannot appear}}
12 (void)[&, foo] () {};
13 (void)[&, &foo] () {}; // expected-error {{'&' cannot precede a capture when}}
14 (void)[&, this] () {};
Douglas Gregor53a9bdf2012-02-01 01:18:43 +000015 }
16};