]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
testsuite: fix escaping of square brackets
authorSam James <sam@gentoo.org>
Wed, 6 Aug 2025 22:25:48 +0000 (23:25 +0100)
committerSam James <sam@gentoo.org>
Wed, 6 Aug 2025 22:28:05 +0000 (23:28 +0100)
This fails for me as:
+ERROR: g++.dg/cpp26/constexpr-new3.C -std=c++26: unknown dg option: 2 for "
  dg-error 40 "accessing value of 'int [2]' object through a 'long int' glvalue in a constant expression" "
otherwise.

Escape '[' and ']'.

gcc/testsuite/ChangeLog:
* g++.dg/cpp26/constexpr-new3.C: Escape '[' and ']'.

gcc/testsuite/g++.dg/cpp26/constexpr-new3.C

index 74661994eb1bd7eb8141e35645ca8403888b6e7e..c79060fc9b6cf6435fda276ff42992ee9e711705 100644 (file)
@@ -37,7 +37,7 @@ baz ()
 {
   std::allocator<int> a;
   auto b = a.allocate (2);
-  new (b) long (42);           // { dg-error "accessing value of 'int [2]' object through a 'long int' glvalue in a constant expression" }
+  new (b) long (42);           // { dg-error "accessing value of 'int \\\[2\\\]' object through a 'long int' glvalue in a constant expression" }
   a.deallocate (b, 2);
   return true;
 }