]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - libstdc++-v3/testsuite/21_strings/basic_string/allocator/wchar_t/minimal.cc
Update copyright years.
[thirdparty/gcc.git] / libstdc++-v3 / testsuite / 21_strings / basic_string / allocator / wchar_t / minimal.cc
index bfba87cc76bb289d553f8d5fc05ac1905515469f..ed791747df33336cad980c288264ab9d946aef44 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2015 Free Software Foundation, Inc.
+// Copyright (C) 2015-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
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
-// { dg-options "-std=gnu++11" }
+// { dg-do run { target c++11 } }
+// COW strings don't support C++11 allocators:
+// { dg-require-effective-target cxx11-abi }
 
 #include <string>
 #include <memory>
 #include <testsuite_hooks.h>
 #include <testsuite_allocator.h>
  
-using C = char;
-const C c = 'a';
+using C = wchar_t;
+const C c = L'a';
 using traits = std::char_traits<C>;
 
 using __gnu_test::SimpleAllocator;
 
-template class std::basic_string<C,traits, SimpleAllocator<C>>;
+template class std::basic_string<C, traits, SimpleAllocator<C>>;
 
 void test01()
 {
-#if _GLIBCXX_USE_CXX11_ABI && defined(_GLIBCXX_USE_WCHAR_T)
   typedef SimpleAllocator<C> alloc_type;
   typedef std::allocator_traits<alloc_type> traits_type;
   typedef std::basic_string<C, traits, alloc_type> test_type;
   test_type v(alloc_type{});
   v.assign(1, c);
   v.assign(100, c);
-#endif
 }
 
 int main()