Add a lambda example from the working draft.

llvm-svn: 150239
This commit is contained in:
Douglas Gregor 2012-02-10 09:37:05 +00:00
parent 3fae4aeae4
commit 136b2f24f0
1 changed files with 9 additions and 0 deletions

View File

@ -14,3 +14,12 @@ class X0 {
(void)[&, this] () {};
}
};
struct S2 { void f(int i); };
void S2::f(int i) {
(void)[&, i]{ };
(void)[&, &i]{ }; // expected-error{{'&' cannot precede a capture when the capture default is '&'}}
(void)[=, this]{ }; // expected-error{{'this' cannot appear in a capture list when the capture default is '='}}
(void)[i, i]{ }; // expected-error{{'i' can appear only once in a capture list}}
}