diff libstdc++-v3/testsuite/util/testsuite_hooks.h @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents 84e7813d76e9
children
line wrap: on
line diff
--- a/libstdc++-v3/testsuite/util/testsuite_hooks.h	Thu Oct 25 07:37:49 2018 +0900
+++ b/libstdc++-v3/testsuite/util/testsuite_hooks.h	Thu Feb 13 11:34:05 2020 +0900
@@ -1,7 +1,7 @@
 // -*- C++ -*-
 // Utility subroutines for the C++ library testsuite.
 //
-// Copyright (C) 2000-2018 Free Software Foundation, Inc.
+// Copyright (C) 2000-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
@@ -46,18 +46,25 @@
 #include <bits/c++config.h>
 #include <bits/functexcept.h>
 #include <ctime>
+#include <stdio.h>
 
 #ifdef _GLIBCXX_HAVE_SYS_STAT_H
 #include <sys/stat.h>
 #endif
 
+#ifdef stderr
+# define _VERIFY_PRINT(S, F, L, P, C) __builtin_fprintf(stderr, S, F, L, P, C)
+#else
+# define _VERIFY_PRINT(S, F, L, P, C) __builtin_printf(S, F, L, P, C)
+#endif
+
 #define VERIFY(fn)                                                      \
   do                                                                    \
   {                                                                     \
     if (! (fn))								\
       {									\
-	__builtin_printf("%s:%d: %s: Assertion '%s' failed.\n",		\
-			 __FILE__, __LINE__, __PRETTY_FUNCTION__, #fn); \
+	_VERIFY_PRINT("%s:%d: %s: Assertion '%s' failed.\n",		\
+		      __FILE__, __LINE__, __PRETTY_FUNCTION__, #fn);	\
 	__builtin_abort();						\
       }									\
   } while (false)
@@ -319,13 +326,15 @@
       typedef typename _Container::const_iterator const_iterator;
 
       // Implicit conversion iterator to const_iterator.
-      static const_iterator
+      static void
       iterator_to_const_iterator()
       {
 	_Container v;
-	const_iterator it = v.begin();
-	const_iterator end = v.end();
-	return it == end ? v.end() : it;
+	const_iterator i __attribute__((unused)) = const_iterator(v.begin());
+	const_iterator j __attribute__((unused)) = true ? i : v.begin();
+#if __cplusplus >= 201103L
+	const_iterator k __attribute__((unused)) { v.begin() };
+#endif
       }
     };