diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2016-07-23 21:18:00 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2016-07-23 21:18:00 +0000 |
| commit | 7fd6ba58d980ec2bf312a80444948501dd27d020 (patch) | |
| tree | edca0bf4e09f8229739f171aec5e276fa83e2355 /test/CXX/expr/expr.prim/expr.prim.lambda/p15-star-this-capture.cpp | |
| parent | 2b6b257f4e5503a7a2675bdb8735693db769f75c (diff) | |
Notes
Diffstat (limited to 'test/CXX/expr/expr.prim/expr.prim.lambda/p15-star-this-capture.cpp')
| -rw-r--r-- | test/CXX/expr/expr.prim/expr.prim.lambda/p15-star-this-capture.cpp | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/test/CXX/expr/expr.prim/expr.prim.lambda/p15-star-this-capture.cpp b/test/CXX/expr/expr.prim/expr.prim.lambda/p15-star-this-capture.cpp index eac6c40c6085e..bae1e25add352 100644 --- a/test/CXX/expr/expr.prim/expr.prim.lambda/p15-star-this-capture.cpp +++ b/test/CXX/expr/expr.prim/expr.prim.lambda/p15-star-this-capture.cpp @@ -1,22 +1,22 @@ -// RUN: %clang_cc1 -fsyntax-only -std=c++1z %s -verify - -class NonCopyable { - NonCopyable(const NonCopyable&) = delete; //expected-note3{{explicitly marked deleted here}} - int x = 10; - void foo() { - auto L = [this] { return x; }; - const auto &M = [*this] { return x; };//expected-error{{call to deleted}} - const auto &M2 = [this] () -> auto&& { - ++x; - return [*this] { //expected-error{{call to deleted}} expected-warning{{reference to local}} - return ++x; //expected-error{{read-only}} - }; - }; - const auto &M3 = [*this] () mutable -> auto&& { //expected-error{{call to deleted}} - ++x; - return [this] { // expected-warning{{reference to local}} - return x; - }; - }; - } -}; +// RUN: %clang_cc1 -fsyntax-only -std=c++1z %s -verify
+
+class NonCopyable {
+ NonCopyable(const NonCopyable&) = delete; //expected-note3{{explicitly marked deleted here}}
+ int x = 10;
+ void foo() {
+ auto L = [this] { return x; };
+ const auto &M = [*this] { return x; };//expected-error{{call to deleted}}
+ const auto &M2 = [this] () -> auto&& {
+ ++x;
+ return [*this] { //expected-error{{call to deleted}} expected-warning{{reference to local}}
+ return ++x; //expected-error{{read-only}}
+ };
+ };
+ const auto &M3 = [*this] () mutable -> auto&& { //expected-error{{call to deleted}}
+ ++x;
+ return [this] { // expected-warning{{reference to local}}
+ return x;
+ };
+ };
+ }
+};
|
