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 | 19666fb1aa7dd4428ec9eef4d880acf1c658cc37 (patch) | |
tree | a6c632a35985a9e8507579f3878d052644dcb185 /clang/test/CXX/expr/expr.prim/expr.prim.lambda/p14.cpp | |
parent | a9ed5d76b43db7a95e96dac8e4958fbb666a3af2 (diff) | |
download | bcm5719-llvm-19666fb1aa7dd4428ec9eef4d880acf1c658cc37.tar.gz bcm5719-llvm-19666fb1aa7dd4428ec9eef4d880acf1c658cc37.zip |
Introduce a new initialization entity for lambda captures, and
specialize location information and diagnostics for this entity.
llvm-svn: 150588
Diffstat (limited to 'clang/test/CXX/expr/expr.prim/expr.prim.lambda/p14.cpp')
-rw-r--r-- | clang/test/CXX/expr/expr.prim/expr.prim.lambda/p14.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/clang/test/CXX/expr/expr.prim/expr.prim.lambda/p14.cpp b/clang/test/CXX/expr/expr.prim/expr.prim.lambda/p14.cpp index 1f7580eedc1..e99130fcd63 100644 --- a/clang/test/CXX/expr/expr.prim/expr.prim.lambda/p14.cpp +++ b/clang/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 { |