]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
acinclude.m4 (GLIBCXX_CHECK_COMPILER_FEATURES): Add a function to the test code compi...
authorBenjamin Kosnik <bkoz@redhat.com>
Wed, 16 May 2007 16:47:47 +0000 (16:47 +0000)
committerBenjamin Kosnik <bkoz@gcc.gnu.org>
Wed, 16 May 2007 16:47:47 +0000 (16:47 +0000)
2007-05-11  Benjamin Kosnik  <bkoz@redhat.com>

* acinclude.m4 (GLIBCXX_CHECK_COMPILER_FEATURES): Add a function
to the test code compiled with -ffunction-sections -fdata-sections.
* configure: Regenerate.

* testsuite/22_locale/ctype/scan/wchar_t/1.cc: Remove
_GLIBCXX_USE_WCHAR_T guards as surpufulous.

* testsuite/20_util/make_signed/requirements/typedefs-1.cc: Add
_GLIBCXX_USE_WCHAR_T guards.
* testsuite/20_util/make_signed/requirements/typedefs-2.cc: Same.
* testsuite/20_util/make_unsigned/requirements/typedefs-1.cc: Same.
* testsuite/20_util/make_unsigned/requirements/typedefs-2.cc: Same.

* testsuite/21_strings/char_traits/requirements/wchar_t/typedefs.cc:
Add.
* testsuite/21_strings/char_traits/typedefs/char/1.cc: Move...
* testsuite/21_strings/char_traits/requirements/char/typedefs.cc:
...here.
* testsuite/21_strings/char_traits/typedefs: Remove.
* testsuite/21_strings/char_traits/typedefs/char: Remove.

From-SVN: r124772

libstdc++-v3/ChangeLog
libstdc++-v3/acinclude.m4
libstdc++-v3/configure
libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs-1.cc
libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs-2.cc
libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs-1.cc
libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs-2.cc
libstdc++-v3/testsuite/21_strings/char_traits/requirements/char/typedefs.cc [moved from libstdc++-v3/testsuite/21_strings/char_traits/typedefs/char/1.cc with 66% similarity]
libstdc++-v3/testsuite/21_strings/char_traits/requirements/wchar_t/typedefs.cc [new file with mode: 0644]
libstdc++-v3/testsuite/22_locale/ctype/scan/wchar_t/1.cc

index 5bbf202c64e4f7c1e8408da1f5c0a14738a4aaca..161ea69becd5931cc5f359358fe034303c6b8166 100644 (file)
@@ -1,5 +1,28 @@
 2007-05-11  Benjamin Kosnik  <bkoz@redhat.com>
 
+       * acinclude.m4 (GLIBCXX_CHECK_COMPILER_FEATURES): Add a function
+       to the test code compiled with -ffunction-sections -fdata-sections.
+       * configure: Regenerate.
+
+       * testsuite/22_locale/ctype/scan/wchar_t/1.cc: Remove
+       _GLIBCXX_USE_WCHAR_T guards as surpufulous.
+       
+       * testsuite/20_util/make_signed/requirements/typedefs-1.cc: Add
+       _GLIBCXX_USE_WCHAR_T guards.    
+       * testsuite/20_util/make_signed/requirements/typedefs-2.cc: Same.
+       * testsuite/20_util/make_unsigned/requirements/typedefs-1.cc: Same.
+       * testsuite/20_util/make_unsigned/requirements/typedefs-2.cc: Same.
+
+       * testsuite/21_strings/char_traits/requirements/wchar_t/typedefs.cc: 
+       Add.
+       * testsuite/21_strings/char_traits/typedefs/char/1.cc: Move...
+       * testsuite/21_strings/char_traits/requirements/char/typedefs.cc: 
+       ...here.
+       * testsuite/21_strings/char_traits/typedefs: Remove.
+       * testsuite/21_strings/char_traits/typedefs/char: Remove.
+       
+2007-05-11  Benjamin Kosnik  <bkoz@redhat.com> 
+
        * docs/html/abi.html: Update for gcc-4.1.2 and gcc-4.2.0.
        
 2007-05-14  Kaz Kojima  <kkojima@gcc.gnu.org>
index 18d1840ceb261012529f38e03b6c38b82933f522..646c91078a30c09e501d05738ad7a4858fb52fff 100644 (file)
@@ -171,7 +171,7 @@ AC_DEFUN([GLIBCXX_CHECK_COMPILER_FEATURES], [
   # Check for -ffunction-sections -fdata-sections
   AC_MSG_CHECKING([for g++ that supports -ffunction-sections -fdata-sections])
   CXXFLAGS='-Werror -ffunction-sections -fdata-sections'
-  AC_TRY_COMPILE(, [int foo;], [ac_fdsections=yes], [ac_fdsections=no])
+  AC_TRY_COMPILE(, [int foo; void bar() { };], [ac_fdsections=yes], [ac_fdsections=no])
   if test "$ac_test_CXXFLAGS" = set; then
     CXXFLAGS="$ac_save_CXXFLAGS"
   else
index 6ca6b63d8614de1c1608038cdc23a8f78b1764b7..1dc4cc3cfc52c405637a2965d6e27d6ddc9a313c 100755 (executable)
@@ -8283,7 +8283,7 @@ cat >>conftest.$ac_ext <<_ACEOF
 int
 main ()
 {
-int foo;
+int foo; void bar() { };
   ;
   return 0;
 }
@@ -56578,7 +56578,7 @@ cat >>conftest.$ac_ext <<_ACEOF
 int
 main ()
 {
-int foo;
+int foo; void bar() { };
   ;
   return 0;
 }
index 43fc33a6fd2eb74c22e35510dbbf1b54b32a52b6..0dea4ca073bf7cd3286a1ccd67f89b95fffe18ee 100644 (file)
@@ -47,8 +47,10 @@ void test01()
   typedef make_signed<const char>::type        test22_type;
   VERIFY( (is_same<test22_type, const signed char>::value) );
 
+#ifdef _GLIBCXX_USE_WCHAR_T
   typedef make_signed<volatile wchar_t>::type          test23_type;
   VERIFY( (is_same<test23_type, volatile signed wchar_t>::value) );
+#endif
 
   typedef make_signed<test_enum>::type         test25_type;
   VERIFY( (is_same<test25_type, int>::value) );
index 4dd9bb6e5b695478bd618155a8bf4d8c939bb5dc..377d1d177589d4f597cbc9db461bd40a7a499e41 100644 (file)
@@ -47,8 +47,10 @@ void test01()
   typedef make_signed<const char>::type        test22_type;
   VERIFY( (is_same<test22_type, const signed char>::value) );
 
+#ifdef _GLIBCXX_USE_WCHAR_T
   typedef make_signed<volatile wchar_t>::type          test23_type;
   VERIFY( (is_same<test23_type, volatile signed wchar_t>::value) );
+#endif
 
   typedef make_signed<test_enum>::type         test25_type;
   VERIFY( (is_same<test25_type, short>::value) );
index e204c55f4fd383d964294cc4213ec736e7a44dd4..1270729bedf541f6afca70fa39489f68986c9d31 100644 (file)
@@ -47,8 +47,10 @@ void test01()
   typedef make_unsigned<const char>::type      test22_type;
   VERIFY( (is_same<test22_type, const unsigned char>::value) );
 
+#ifdef _GLIBCXX_USE_WCHAR_T
   typedef make_unsigned<volatile wchar_t>::type        test23_type;
   VERIFY( (is_same<test23_type, volatile unsigned wchar_t>::value) );
+#endif
 
   typedef make_unsigned<test_enum>::type       test25_type;
   VERIFY( (is_same<test25_type, unsigned int>::value) );
index 5038f81e657281c3f6b6d9fd170da8aaefa981ca..1715d36c44af676e351bbe1ace65ecea5ba88d1e 100644 (file)
@@ -47,8 +47,10 @@ void test01()
   typedef make_unsigned<const char>::type      test22_type;
   VERIFY( (is_same<test22_type, const unsigned char>::value) );
 
+#ifdef _GLIBCXX_USE_WCHAR_T
   typedef make_unsigned<volatile wchar_t>::type        test23_type;
   VERIFY( (is_same<test23_type, volatile unsigned wchar_t>::value) );
+#endif
 
   typedef make_unsigned<test_enum>::type       test25_type;
   VERIFY( (is_same<test25_type, unsigned short>::value) );
similarity index 66%
rename from libstdc++-v3/testsuite/21_strings/char_traits/typedefs/char/1.cc
rename to libstdc++-v3/testsuite/21_strings/char_traits/requirements/char/typedefs.cc
index 5373d6a4be31043adcf03abb34fca6da774fe65a..94b719e9017a5d1e7cc8c441d63f73d33d682933 100644 (file)
@@ -1,7 +1,9 @@
+// dg-do compile
+// dg-options -ansi -pedantic-err
 // 2001-02-11 gdr
 // Origin: Craig Rodrigues <rodrigc@mediaone.net>
 
-// Copyright (C) 2001, 2003 Free Software Foundation, Inc.
+// Copyright (C) 2001, 2003, 2007 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
 
 int main()
 {
+  // Check for required typedefs.
+  typedef std::char_traits<char> test_type;
+  typedef test_type::char_type char_type;
+  typedef test_type::int_type int_type;
+  typedef test_type::off_type off_type;
+  typedef test_type::pos_type pos_type;
+  typedef test_type::state_type state_type;
+
   // 21.1.3: char_traits<char>::int_type == int
-  // dg-options -ansi -pedantic-err
-  std::char_traits<char>::int_type* p = 0;
-  int* q __attribute__((unused)) = p;                   // dg-do compile
+  test_type::int_type* p = 0;
+  int* q __attribute__((unused)) = p;                   
 
   return 0;
 }
diff --git a/libstdc++-v3/testsuite/21_strings/char_traits/requirements/wchar_t/typedefs.cc b/libstdc++-v3/testsuite/21_strings/char_traits/requirements/wchar_t/typedefs.cc
new file mode 100644 (file)
index 0000000..e788daf
--- /dev/null
@@ -0,0 +1,43 @@
+// dg-do compile
+// dg-options -ansi -pedantic-err
+// 2001-02-11 gdr
+// Origin: Craig Rodrigues <rodrigc@mediaone.net>
+
+// Copyright (C) 2001, 2003, 2007 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
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING.  If not, write to the Free
+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+
+// 21.1.2: char_traits typedefs
+
+#include <string>
+
+int main()
+{
+  // Check for required typedefs.
+  typedef std::char_traits<wchar_t> test_type;
+  typedef test_type::char_type char_type;
+  typedef test_type::int_type int_type;
+  typedef test_type::off_type off_type;
+  typedef test_type::pos_type pos_type;
+  typedef test_type::state_type state_type;
+
+  // 21.1.3: char_traits<wchar_t>::int_type == wint_t
+  test_type::int_type* p = 0;
+  wint_t* q __attribute__((unused)) = p;                   
+
+  return 0;
+}
index a1e41d86b713a1d07224c31dd0ca432656b73d70..dce0d951c4d644a39fe955c7f5e669f1fa36a562 100644 (file)
@@ -1,6 +1,6 @@
 // 2002-05-10 ghazi
 
-// Copyright (C) 2002 Free Software Foundation, Inc.
+// Copyright (C) 2002, 2007 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
@@ -47,7 +47,6 @@ class gnu_ctype: public std::ctype<char_type> { };
   VERIFY(gctype.scan_not((MASK), (STRING), \
                         (STRING) + traits_type::length(STRING)) == (EXPECTED))
 
-#ifdef _GLIBCXX_USE_WCHAR_T
 // Sanity check scan_is() and scan_not().
 void test01()
 {
@@ -341,12 +340,9 @@ void test01()
   VERIFY_SCAN_NOT (std::ctype_base::upper, p2, p2);
   VERIFY_SCAN_NOT (std::ctype_base::xdigit, p2, p2);
 }
-#endif
 
 int main() 
 {
-#ifdef _GLIBCXX_USE_WCHAR_T
   test01();
-#endif
   return 0;
 }