blob: 4c876d7480de41ea276bf773ec31610638435391 [file] [log] [blame]
Douglas Gregore31e6062012-02-07 10:09:13 +00001// RUN: %clang_cc1 -fsyntax-only -std=c++11 %s -verify
2
3class NonCopyable {
4 NonCopyable(const NonCopyable&); // expected-note 2 {{implicitly declared private here}}
5};
6
7void capture_by_copy(NonCopyable nc, NonCopyable &ncr) {
8 // FIXME: error messages should talk about capture
Douglas Gregor8c50e7c2012-02-09 00:47:04 +00009 (void)[nc] { }; // expected-error{{field of type 'NonCopyable' has private copy constructor}} \
Douglas Gregore31e6062012-02-07 10:09:13 +000010 // expected-error{{lambda expressions are not supported yet}}
Douglas Gregor8c50e7c2012-02-09 00:47:04 +000011 (void)[ncr] { }; // expected-error{{field of type 'NonCopyable' has private copy constructor}} \
Douglas Gregore31e6062012-02-07 10:09:13 +000012 // expected-error{{lambda expressions are not supported yet}}
13}
14
Douglas Gregor8c50e7c2012-02-09 00:47:04 +000015struct NonTrivial {
16 NonTrivial();
17 NonTrivial(const NonTrivial &);
18 ~NonTrivial();
19};
20
21struct CopyCtorDefault {
22 CopyCtorDefault(const CopyCtorDefault&, NonTrivial nt = NonTrivial());
23
24 void foo() const;
25};
26
27void capture_with_default_args(CopyCtorDefault cct) {
28 (void)[=] () -> void { cct.foo(); }; // expected-error{{lambda expressions are not supported yet}}
29}
30
Douglas Gregore31e6062012-02-07 10:09:13 +000031// FIXME: arrays!