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 | 02267a8e4888054b51d2e993b5b6d71ddd88961e (patch) | |
tree | 156935e847ee60e72ed2eaad0899d41cc2c4bc97 /clang/test/CXX/expr/expr.prim/expr.prim.lambda/p14.cpp | |
parent | 19666fb1aa7dd4428ec9eef4d880acf1c658cc37 (diff) | |
download | bcm5719-llvm-02267a8e4888054b51d2e993b5b6d71ddd88961e.tar.gz bcm5719-llvm-02267a8e4888054b51d2e993b5b6d71ddd88961e.zip |
A little more lambda capture initialization diagnostics cleanup
llvm-svn: 150589
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, 8 insertions, 1 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 e99130fcd63..678fa4b964d 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 @@ -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 { |