]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - libstdc++-v3/testsuite/28_regex/sub_match/cast_char.cc
Update copyright years.
[thirdparty/gcc.git] / libstdc++-v3 / testsuite / 28_regex / sub_match / cast_char.cc
index 6beb9c5cdb2992bbb83059be3e982446b73da8e2..292e53dad27eb82d91ddd4155664894b2c5fb7ef 100644 (file)
@@ -1,10 +1,9 @@
-// { dg-do compile }
-// { dg-options "-std=c++0x" }
+// { dg-do run { target c++11 } }
 
 //
 // 2010-06-09  Stephen M. Webb <stephen.webb@bregmasoft.ca>
 //
-// Copyright (C) 2010 Free Software Foundation, Inc.
+// Copyright (C) 2010-2020 Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
 // software; you can redistribute it and/or modify it under the
 #include <string>
 #include <testsuite_hooks.h>
 
-
-void
-test01()
+int main()
 {
-  bool test __attribute__((unused)) = true;
-
   typedef char                          value_type;
   typedef std::basic_string<value_type> string_type;
   typedef std::sub_match<value_type*>   sub_match_type;
   value_type test_data[] = "cabbage";
 
-       sub_match_type sm;
-       sm.first = test_data + 0;
-       sm.second  = test_data + sizeof(test_data)/sizeof(value_type);
-       sm.matched = true;
+  sub_match_type sm;
+  sm.first = std::begin(test_data);
+  sm.second  = std::end(test_data) - 1;
+  sm.matched = true;
 
-       string_type sm_string = sm;
+  string_type sm_string = sm;
 
-       VERIFY( sm_string == string_type(test_data) );
+  VERIFY( sm_string == string_type(test_data) );
 }