blob: b4b1605ab0025e4be6f55c324a8b203cceb7f6ea [file] [log] [blame]
Douglas Gregore31e6062012-02-07 10:09:13 +00001// RUN: %clang_cc1 -fsyntax-only -std=c++11 %s -verify
Andy Gibbsc6e68da2012-10-19 12:44:48 +00002// expected-no-diagnostics
Douglas Gregore31e6062012-02-07 10:09:13 +00003
4class NonCopyable {
5 NonCopyable(const NonCopyable&);
6};
7
8void capture_by_ref(NonCopyable nc, NonCopyable &ncr) {
Douglas Gregor199cec72012-02-09 02:45:47 +00009 int array[3];
Douglas Gregor656bc622012-02-09 08:26:42 +000010 (void)[&nc] () -> void {};
11 (void)[&ncr] () -> void {};
12 (void)[&array] () -> void {};
Douglas Gregore31e6062012-02-07 10:09:13 +000013}