diff options
author | Douglas Gregor <dgregor@apple.com> | 2012-02-10 09:37:05 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2012-02-10 09:37:05 +0000 |
commit | 136b2f24f0d55f6fb8ee9b40ae30cbd83e13319c (patch) | |
tree | 4dbeeace2418f3ae4923e15bbaef1741646d9f8e /clang/test/CXX/expr/expr.prim/expr.prim.lambda/p8.cpp | |
parent | 3fae4aeae49082b443d9c3f388040c2b719d3f6a (diff) | |
download | bcm5719-llvm-136b2f24f0d55f6fb8ee9b40ae30cbd83e13319c.tar.gz bcm5719-llvm-136b2f24f0d55f6fb8ee9b40ae30cbd83e13319c.zip |
Add a lambda example from the working draft.
llvm-svn: 150239
Diffstat (limited to 'clang/test/CXX/expr/expr.prim/expr.prim.lambda/p8.cpp')
-rw-r--r-- | clang/test/CXX/expr/expr.prim/expr.prim.lambda/p8.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/test/CXX/expr/expr.prim/expr.prim.lambda/p8.cpp b/clang/test/CXX/expr/expr.prim/expr.prim.lambda/p8.cpp index 8f524e08245..b897d5f10a3 100644 --- a/clang/test/CXX/expr/expr.prim/expr.prim.lambda/p8.cpp +++ b/clang/test/CXX/expr/expr.prim/expr.prim.lambda/p8.cpp @@ -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}} +} |