c++: Fix cpp0x/lambda/lambda-nested9.C with C++11
authorMarek Polacek <polacek@redhat.com>
Fri, 19 Nov 2021 19:54:18 +0000 (14:54 -0500)
committerMarek Polacek <polacek@redhat.com>
Fri, 19 Nov 2021 19:59:12 +0000 (14:59 -0500)
Unfortunately dejagnu doesn't honor #if/#endif, so this test was failing
with -std=c++11:

FAIL: g++.dg/cpp0x/lambda/lambda-nested9.C  -std=c++11  (test for errors, line 37)

Fixed thus.

gcc/testsuite/ChangeLog:

* g++.dg/cpp0x/lambda/lambda-nested9.C: Adjust dg-error.

gcc/testsuite/g++.dg/cpp0x/lambda/lambda-nested9.C

index ff7da3b..8f67f22 100644 (file)
@@ -34,7 +34,7 @@ int main() {
 #if __cpp_init_captures
   [j=0] () {
     [&] () mutable {
-      ++j; // { dg-error "read-only" }
+      ++j; // { dg-error "read-only" "" { target c++14 } }
     };
   };
 #endif