diff options
author | Douglas Gregor <dgregor@apple.com> | 2012-02-15 17:05:32 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2012-02-15 17:05:32 +0000 |
commit | 87c5150752baafab380e5f7837a32410fa83c7dc (patch) | |
tree | 9e5404a2763576ee72005c64efafd64baa3e14b7 /test/CXX/expr/expr.prim/expr.prim.lambda/p14.cpp | |
parent | 4773654f2700d6fbb20612fbb6763b35860fa74d (diff) |
A little more lambda capture initialization diagnostics cleanup
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150589 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CXX/expr/expr.prim/expr.prim.lambda/p14.cpp')
-rw-r--r-- | test/CXX/expr/expr.prim/expr.prim.lambda/p14.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/test/CXX/expr/expr.prim/expr.prim.lambda/p14.cpp b/test/CXX/expr/expr.prim/expr.prim.lambda/p14.cpp index e99130fcd6..678fa4b964 100644 --- a/test/CXX/expr/expr.prim/expr.prim.lambda/p14.cpp +++ b/test/CXX/expr/expr.prim/expr.prim.lambda/p14.cpp @@ -8,11 +8,18 @@ public: void foo() const; }; -void capture_by_copy(NonCopyable nc, NonCopyable &ncr) { +class NonConstCopy { +public: + NonConstCopy(NonConstCopy&); // expected-note{{would lose const}} +}; + +void capture_by_copy(NonCopyable nc, NonCopyable &ncr, const NonConstCopy nco) { (void)[nc] { }; // expected-error{{capture of variable 'nc' as type 'NonCopyable' calls private copy constructor}} (void)[=] { ncr.foo(); // expected-error{{capture of variable 'ncr' as type 'NonCopyable' calls private copy constructor}} }(); + + [nco] {}(); // expected-error{{no matching constructor for initialization of 'const NonConstCopy'}} } struct NonTrivial { |