aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorMarek Polacek <polacek@redhat.com>2023-11-10 19:36:17 -0500
committerMarek Polacek <polacek@redhat.com>2023-11-10 19:36:40 -0500
commit08354f5c46c4443c347fd048dd3b1115b14e705d (patch)
tree5d35165472dcc5591b533c51b45c742f358cf1c9 /gcc
parente0c1476d5d7c450b1b16a40364cea4e91237ea93 (diff)
downloadgcc-08354f5c46c4443c347fd048dd3b1115b14e705d.zip
gcc-08354f5c46c4443c347fd048dd3b1115b14e705d.tar.gz
gcc-08354f5c46c4443c347fd048dd3b1115b14e705d.tar.bz2
testsuite: fix lambda-decltype3.C in C++11
This fixes FAIL: g++.dg/cpp0x/lambda/lambda-decltype3.C -std=c++11 (test for excess errors) due to lambda-decltype3.C:25:6: error: lambda capture initializers only available with '-std=c++14' or '-std=gnu++14' [-Wc++14-extensions] gcc/testsuite/ChangeLog: * g++.dg/cpp0x/lambda/lambda-decltype3.C: Check __cpp_init_captures.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/lambda/lambda-decltype3.C2
1 files changed, 2 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-decltype3.C b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-decltype3.C
index 7fc157a..2e06e49 100644
--- a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-decltype3.C
+++ b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-decltype3.C
@@ -21,8 +21,10 @@ void f() {
[=] {
[](decltype((x)) y) {}; // OK, lambda takes a parameter of type float const&
+#if __cpp_init_captures
[x=1](decltype((x)) y) {
decltype((x)) z = x; // OK, y has type int&, z has type int const&
};
+#endif
};
}