aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2018-10-23 18:25:09 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2018-10-23 18:25:09 +0200
commit53aba487466da8adf18f69380b6efddbbb65f04f (patch)
treeb758716edb2d3285453393e6f6218d35b7801b39
parentc3ba63c314d61362f7c48c4feeefa13ea3978344 (diff)
downloadgcc-53aba487466da8adf18f69380b6efddbbb65f04f.zip
gcc-53aba487466da8adf18f69380b6efddbbb65f04f.tar.gz
gcc-53aba487466da8adf18f69380b6efddbbb65f04f.tar.bz2
lambda-this3.C: Limit dg-bogus directives to c++17_down only.
* g++.dg/cpp2a/lambda-this3.C: Limit dg-bogus directives to c++17_down only. Add expected warnings and messages for c++2a. From-SVN: r265430
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/lambda-this3.C16
2 files changed, 17 insertions, 4 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index fe6699e..1e99273 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2018-10-23 Jakub Jelinek <jakub@redhat.com>
+
+ * g++.dg/cpp2a/lambda-this3.C: Limit dg-bogus directives to c++17_down
+ only. Add expected warnings and messages for c++2a.
+
2018-10-23 Richard Biener <rguenther@suse.de>
PR tree-optimization/87105
diff --git a/gcc/testsuite/g++.dg/cpp2a/lambda-this3.C b/gcc/testsuite/g++.dg/cpp2a/lambda-this3.C
index d1738ea..b2d30d6 100644
--- a/gcc/testsuite/g++.dg/cpp2a/lambda-this3.C
+++ b/gcc/testsuite/g++.dg/cpp2a/lambda-this3.C
@@ -5,7 +5,9 @@
struct X {
int x;
void foo (int n) {
- auto a1 = [=] { x = n; }; // { dg-bogus "implicit capture" }
+ auto a1 = [=] { x = n; }; // { dg-bogus "implicit capture" "" { target c++17_down } }
+ // { dg-warning "implicit capture of 'this' via '\\\[=\\\]' is deprecated" "" { target c++2a } .-1 }
+ // { dg-message "add explicit 'this' or '\\\*this' capture" "" { target c++2a } .-2 }
auto a2 = [=, this] { x = n; };
// { dg-warning "explicit by-copy capture" "" { target c++17_down } .-1 }
auto a3 = [=, *this]() mutable { x = n; };
@@ -13,9 +15,15 @@ struct X {
auto a5 = [&, this] { x = n; };
auto a6 = [&, *this]() mutable { x = n; };
- auto a7 = [=] { // { dg-bogus "implicit capture" }
- auto a = [=] { // { dg-bogus "implicit capture" }
- auto a2 = [=] { x = n; }; // { dg-bogus "implicit capture" }
+ auto a7 = [=] { // { dg-bogus "implicit capture" "" { target c++17_down } }
+ // { dg-warning "implicit capture of 'this' via '\\\[=\\\]' is deprecated" "" { target c++2a } .-1 }
+ // { dg-message "add explicit 'this' or '\\\*this' capture" "" { target c++2a } .-2 }
+ auto a = [=] { // { dg-bogus "implicit capture" "" { target c++17_down } }
+ // { dg-warning "implicit capture of 'this' via '\\\[=\\\]' is deprecated" "" { target c++2a } .-1 }
+ // { dg-message "add explicit 'this' or '\\\*this' capture" "" { target c++2a } .-2 }
+ auto a2 = [=] { x = n; }; // { dg-bogus "implicit capture" "" { target c++17_down } }
+ // { dg-warning "implicit capture of 'this' via '\\\[=\\\]' is deprecated" "" { target c++2a } .-1 }
+ // { dg-message "add explicit 'this' or '\\\*this' capture" "" { target c++2a } .-2 }
};
};