Douglas Gregor | e31e606 | 2012-02-07 10:09:13 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fsyntax-only -std=c++11 %s -verify |
Andy Gibbs | c6e68da | 2012-10-19 12:44:48 +0000 | [diff] [blame] | 2 | // expected-no-diagnostics |
Douglas Gregor | e31e606 | 2012-02-07 10:09:13 +0000 | [diff] [blame] | 3 | |
| 4 | class NonCopyable { |
| 5 | NonCopyable(const NonCopyable&); |
| 6 | }; |
| 7 | |
| 8 | void capture_by_ref(NonCopyable nc, NonCopyable &ncr) { |
Douglas Gregor | 199cec7 | 2012-02-09 02:45:47 +0000 | [diff] [blame] | 9 | int array[3]; |
Douglas Gregor | 656bc62 | 2012-02-09 08:26:42 +0000 | [diff] [blame] | 10 | (void)[&nc] () -> void {}; |
| 11 | (void)[&ncr] () -> void {}; |
| 12 | (void)[&array] () -> void {}; |
Douglas Gregor | e31e606 | 2012-02-07 10:09:13 +0000 | [diff] [blame] | 13 | } |