diff options
author | Douglas Gregor <dgregor@apple.com> | 2012-02-15 16:57:26 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2012-02-15 16:57:26 +0000 |
commit | 4773654f2700d6fbb20612fbb6763b35860fa74d (patch) | |
tree | 48bb63d5d1bdca8926cba42f0fac882e6cd2433f /test/CXX/expr/expr.prim/expr.prim.lambda/p14.cpp | |
parent | badb6cd2007825308208e6c4275ba54e220e4e28 (diff) |
Introduce a new initialization entity for lambda captures, and
specialize location information and diagnostics for this entity.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150588 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, 6 insertions, 3 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 1f7580eedc..e99130fcd6 100644 --- a/test/CXX/expr/expr.prim/expr.prim.lambda/p14.cpp +++ b/test/CXX/expr/expr.prim/expr.prim.lambda/p14.cpp @@ -4,12 +4,15 @@ template<typename T> void capture(const T&); class NonCopyable { NonCopyable(const NonCopyable&); // expected-note 2 {{implicitly declared private here}} +public: + void foo() const; }; void capture_by_copy(NonCopyable nc, NonCopyable &ncr) { - // FIXME: error messages should talk about capture - (void)[nc] { }; // expected-error{{field of type 'NonCopyable' has private copy constructor}} - (void)[ncr] { }; // expected-error{{field of type 'NonCopyable' has private copy constructor}} + (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}} + }(); } struct NonTrivial { |