OSDN Git Service

2004-11-02 Benjamin Kosnik <bkoz@redhat.com>
authorbkoz <bkoz@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 2 Nov 2004 19:00:19 +0000 (19:00 +0000)
committerbkoz <bkoz@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 2 Nov 2004 19:00:19 +0000 (19:00 +0000)
PR libstdc++/17922
* include/bits/ios_base.h : Add enum values.
* testsuite/testsuite_hooks.h (bitmask_operators): Add function.
* testsuite/27_io/ios_base/types/fmtflags/bitmask_operators.cc: New.
* testsuite/27_io/ios_base/types/fmtflags/case_label.cc: New.
* testsuite/27_io/ios_base/types/iostate/bitmask_operators.cc: New.
* testsuite/27_io/ios_base/types/iostate/case_label.cc: New.
* testsuite/27_io/ios_base/types/openmode/bitmask_operators.cc: New.
* testsuite/27_io/ios_base/types/openmode/case_label.cc: New.
* testsuite/27_io/ios_base/types/seekdir/case_label.cc: New.

* config/io/c_io_stdio.h (__ios_flags): Mark deprecated.
* src/ios.cc: Same.

* testsuite/27_io/ios_base/cons/assign_neg.cc: Adjust line numbers.
* testsuite/27_io/ios_base/cons/copy_neg.cc: Same.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@89996 138bc75d-0d04-0410-961f-82ee72b054a4

14 files changed:
libstdc++-v3/ChangeLog
libstdc++-v3/config/io/c_io_stdio.h
libstdc++-v3/include/bits/ios_base.h
libstdc++-v3/src/ios.cc
libstdc++-v3/testsuite/27_io/ios_base/cons/assign_neg.cc
libstdc++-v3/testsuite/27_io/ios_base/cons/copy_neg.cc
libstdc++-v3/testsuite/27_io/ios_base/types/fmtflags/bitmask_operators.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/ios_base/types/fmtflags/case_label.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/ios_base/types/iostate/bitmask_operators.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/ios_base/types/iostate/case_label.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/ios_base/types/openmode/bitmask_operators.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/ios_base/types/openmode/case_label.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/ios_base/types/seekdir/case_label.cc [new file with mode: 0644]
libstdc++-v3/testsuite/testsuite_hooks.h

index 4e61672..0b05453 100644 (file)
@@ -1,3 +1,22 @@
+2004-11-02  Benjamin Kosnik  <bkoz@redhat.com>
+
+       PR libstdc++/17922
+       * include/bits/ios_base.h : Add enum values.
+       * testsuite/testsuite_hooks.h (bitmask_operators): Add function.
+       * testsuite/27_io/ios_base/types/fmtflags/bitmask_operators.cc: New.
+       * testsuite/27_io/ios_base/types/fmtflags/case_label.cc: New.
+       * testsuite/27_io/ios_base/types/iostate/bitmask_operators.cc: New.
+       * testsuite/27_io/ios_base/types/iostate/case_label.cc: New.
+       * testsuite/27_io/ios_base/types/openmode/bitmask_operators.cc: New.
+       * testsuite/27_io/ios_base/types/openmode/case_label.cc: New.
+       * testsuite/27_io/ios_base/types/seekdir/case_label.cc: New.
+
+       * config/io/c_io_stdio.h (__ios_flags): Mark deprecated.
+       * src/ios.cc: Same.
+
+       * testsuite/27_io/ios_base/cons/assign_neg.cc: Adjust line numbers.
+       * testsuite/27_io/ios_base/cons/copy_neg.cc: Same.
+
 2004-11-01  Momchil Velikov  <velco@fadata.bg>
 
        PR libstdc++/18185
index c9ae432..5659c13 100644 (file)
@@ -1,6 +1,6 @@
 // underlying io library  -*- C++ -*-
 
-// Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+// Copyright (C) 2000, 2001, 2002, 2003, 2004 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
@@ -43,6 +43,7 @@ namespace std
   // for basic_file.h
   typedef FILE __c_file;
 
+  // XXX GLIBCXX_ABI Deprecated
   // for ios_base.h
   struct __ios_flags
   {
index eb97a49..2855b5b 100644 (file)
@@ -52,7 +52,28 @@ namespace std
   // as permitted (but not required) in the standard, in order to provide
   // better type safety in iostream calls.  A side effect is that
   // expressions involving them are no longer compile-time constants.
-  enum _Ios_Fmtflags { _S_ios_fmtflags_end = 1L << 16 };
+  enum _Ios_Fmtflags 
+    { 
+      _S_boolalpha     = 1L << 0,
+      _S_dec           = 1L << 1,
+      _S_fixed                 = 1L << 2,
+      _S_hex           = 1L << 3,
+      _S_internal      = 1L << 4,
+      _S_left          = 1L << 5,
+      _S_oct           = 1L << 6,
+      _S_right                 = 1L << 7,
+      _S_scientific    = 1L << 8,
+      _S_showbase      = 1L << 9,
+      _S_showpoint     = 1L << 10,
+      _S_showpos       = 1L << 11,
+      _S_skipws        = 1L << 12,
+      _S_unitbuf       = 1L << 13,
+      _S_uppercase     = 1L << 14,
+      _S_adjustfield   = _S_left | _S_right | _S_internal,
+      _S_basefield     = _S_dec | _S_oct | _S_hex,
+      _S_floatfield    = _S_scientific | _S_fixed,
+      _S_ios_fmtflags_end = 1L << 16 
+    };
 
   inline _Ios_Fmtflags
   operator&(_Ios_Fmtflags __a, _Ios_Fmtflags __b)
@@ -66,15 +87,15 @@ namespace std
   operator^(_Ios_Fmtflags __a, _Ios_Fmtflags __b)
   { return _Ios_Fmtflags(static_cast<int>(__a) ^ static_cast<int>(__b)); }
 
-  inline _Ios_Fmtflags
+  inline _Ios_Fmtflags&
   operator|=(_Ios_Fmtflags& __a, _Ios_Fmtflags __b)
   { return __a = __a | __b; }
 
-  inline _Ios_Fmtflags
+  inline _Ios_Fmtflags&
   operator&=(_Ios_Fmtflags& __a, _Ios_Fmtflags __b)
   { return __a = __a & __b; }
 
-  inline _Ios_Fmtflags
+  inline _Ios_Fmtflags&
   operator^=(_Ios_Fmtflags& __a, _Ios_Fmtflags __b)
   { return __a = __a ^ __b; }
 
@@ -83,7 +104,16 @@ namespace std
   { return _Ios_Fmtflags(~static_cast<int>(__a)); }
 
 
-  enum _Ios_Openmode { _S_ios_openmode_end = 1L << 16 };
+  enum _Ios_Openmode 
+    { 
+      _S_app           = 1L << 0,
+      _S_ate           = 1L << 1,
+      _S_bin           = 1L << 2,
+      _S_in            = 1L << 3,
+      _S_out           = 1L << 4,
+      _S_trunc                 = 1L << 5,
+      _S_ios_openmode_end = 1L << 16 
+    };
 
   inline _Ios_Openmode
   operator&(_Ios_Openmode __a, _Ios_Openmode __b)
@@ -97,15 +127,15 @@ namespace std
   operator^(_Ios_Openmode __a, _Ios_Openmode __b)
   { return _Ios_Openmode(static_cast<int>(__a) ^ static_cast<int>(__b)); }
 
-  inline _Ios_Openmode
+  inline _Ios_Openmode&
   operator|=(_Ios_Openmode& __a, _Ios_Openmode __b)
   { return __a = __a | __b; }
 
-  inline _Ios_Openmode
+  inline _Ios_Openmode&
   operator&=(_Ios_Openmode& __a, _Ios_Openmode __b)
   { return __a = __a & __b; }
 
-  inline _Ios_Openmode
+  inline _Ios_Openmode&
   operator^=(_Ios_Openmode& __a, _Ios_Openmode __b)
   { return __a = __a ^ __b; }
 
@@ -114,7 +144,14 @@ namespace std
   { return _Ios_Openmode(~static_cast<int>(__a)); }
 
 
-  enum _Ios_Iostate { _S_ios_iostate_end = 1L << 16 };
+  enum _Ios_Iostate
+    { 
+      _S_goodbit               = 0,
+      _S_badbit                = 1L << 0,
+      _S_eofbit                = 1L << 1,
+      _S_failbit               = 1L << 2,
+      _S_ios_iostate_end = 1L << 16 
+    };
 
   inline _Ios_Iostate
   operator&(_Ios_Iostate __a, _Ios_Iostate __b)
@@ -128,15 +165,15 @@ namespace std
   operator^(_Ios_Iostate __a, _Ios_Iostate __b)
   { return _Ios_Iostate(static_cast<int>(__a) ^ static_cast<int>(__b)); }
 
-  inline _Ios_Iostate
+  inline _Ios_Iostate&
   operator|=(_Ios_Iostate& __a, _Ios_Iostate __b)
   { return __a = __a | __b; }
 
-  inline _Ios_Iostate
+  inline _Ios_Iostate&
   operator&=(_Ios_Iostate& __a, _Ios_Iostate __b)
   { return __a = __a & __b; }
 
-  inline _Ios_Iostate
+  inline _Ios_Iostate&
   operator^=(_Ios_Iostate& __a, _Ios_Iostate __b)
   { return __a = __a ^ __b; }
 
@@ -144,7 +181,13 @@ namespace std
   operator~(_Ios_Iostate __a)
   { return _Ios_Iostate(~static_cast<int>(__a)); }
 
-  enum _Ios_Seekdir { _S_ios_seekdir_end = 1L << 16 };
+  enum _Ios_Seekdir 
+    { 
+      _S_beg = 0,
+      _S_cur = SEEK_CUR,
+      _S_end = SEEK_END,
+      _S_ios_seekdir_end = 1L << 16 
+    };
 
   // 27.4.2  Class ios_base
   /**
index 09b2929..70b22f6 100644 (file)
@@ -37,8 +37,9 @@
 #include <bits/atomicity.h>
 
 namespace std 
-{
-  // Definitions for static const data members of __ios_flags.
+{  
+  // XXX GLIBCXX_ABI Deprecated
+   // Definitions for static const data members of __ios_flags.
   const __ios_flags::__int_type __ios_flags::_S_boolalpha;
   const __ios_flags::__int_type __ios_flags::_S_dec;
   const __ios_flags::__int_type __ios_flags::_S_fixed;
index ca3e3c9..50c8eb8 100644 (file)
@@ -41,5 +41,5 @@ void test01()
   io1 = io2;
 }
 // { dg-error "within this context" "" { target *-*-* } 41 } 
-// { dg-error "is private" "" { target *-*-* } 739 } 
+// { dg-error "is private" "" { target *-*-* } 782 } 
 // { dg-error "operator=" "" { target *-*-* } 0 } 
index 013138d..925087d 100644 (file)
@@ -41,5 +41,5 @@ void test02()
   test_base io2 = io1; 
 }
 // { dg-error "within this context" "" { target *-*-* } 41 } 
-// { dg-error "is private" "" { target *-*-* } 736 } 
+// { dg-error "is private" "" { target *-*-* } 779 } 
 // { dg-error "copy constructor" "" { target *-*-* } 0 } 
diff --git a/libstdc++-v3/testsuite/27_io/ios_base/types/fmtflags/bitmask_operators.cc b/libstdc++-v3/testsuite/27_io/ios_base/types/fmtflags/bitmask_operators.cc
new file mode 100644 (file)
index 0000000..4f16d15
--- /dev/null
@@ -0,0 +1,39 @@
+// { dg-do compile }
+// -*- C++ -*-
+// Copyright (C) 2004 Free Software Foundation, Inc.
+// 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, 59 Temple Place - Suite 330, Boston,
+// MA 02111-1307, USA.
+// As a special exception, you may use this file as part of a free
+// software library without restriction.  Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to
+// produce an executable, this file does not by itself cause the
+// resulting executable to be covered by the GNU General Public
+// License.  This exception does not however invalidate any other
+// reasons why the executable file might be covered by the GNU General
+// Public License.
+// Benjamin Kosnik  <bkoz@redhat.com>
+
+#include <ios>
+#include <testsuite_hooks.h>
+
+int main()
+{
+  __gnu_test::bitmask_operators<std::ios_base::fmtflags>();
+};
diff --git a/libstdc++-v3/testsuite/27_io/ios_base/types/fmtflags/case_label.cc b/libstdc++-v3/testsuite/27_io/ios_base/types/fmtflags/case_label.cc
new file mode 100644 (file)
index 0000000..3c4e6af
--- /dev/null
@@ -0,0 +1,84 @@
+// { dg-do compile }
+// { dg-options "-Wall" { target *-*-* } }
+// -*- C++ -*-
+// Copyright (C) 2004 Free Software Foundation, Inc.
+// 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, 59 Temple Place - Suite 330, Boston,
+// MA 02111-1307, USA.
+// As a special exception, you may use this file as part of a free
+// software library without restriction.  Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to
+// produce an executable, this file does not by itself cause the
+// resulting executable to be covered by the GNU General Public
+// License.  This exception does not however invalidate any other
+// reasons why the executable file might be covered by the GNU General
+// Public License.
+// Benjamin Kosnik  <bkoz@redhat.com>
+
+#include <ios>
+
+// PR libstdc++/17922
+// -Wall
+typedef std::ios_base::fmtflags bitmask_type;
+
+void
+case_labels(bitmask_type b)
+{
+  switch (b) 
+    {
+    case std::ios_base::boolalpha:
+      break;
+    case std::ios_base::dec:
+      break;
+    case std::ios_base::fixed:
+      break;
+    case std::ios_base::hex:
+      break;
+    case std::ios_base::internal:
+      break;
+    case std::ios_base::left:
+      break;
+    case std::ios_base::oct:
+      break;
+    case std::ios_base::right:
+      break;
+    case std::ios_base::scientific:
+      break;
+    case std::ios_base::showbase:
+      break;
+    case std::ios_base::showpoint:
+      break;
+    case std::ios_base::showpos:
+      break;
+    case std::ios_base::skipws:
+      break;
+    case std::ios_base::unitbuf:
+      break;
+    case std::ios_base::uppercase:
+      break;
+    case std::ios_base::adjustfield:
+      break;
+    case std::ios_base::basefield:
+      break;
+    case std::ios_base::floatfield:
+      break;
+    case std::_S_ios_fmtflags_end:
+      break;
+    }
+}
diff --git a/libstdc++-v3/testsuite/27_io/ios_base/types/iostate/bitmask_operators.cc b/libstdc++-v3/testsuite/27_io/ios_base/types/iostate/bitmask_operators.cc
new file mode 100644 (file)
index 0000000..c8a00a0
--- /dev/null
@@ -0,0 +1,39 @@
+// { dg-do compile }
+// -*- C++ -*-
+// Copyright (C) 2004 Free Software Foundation, Inc.
+// 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, 59 Temple Place - Suite 330, Boston,
+// MA 02111-1307, USA.
+// As a special exception, you may use this file as part of a free
+// software library without restriction.  Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to
+// produce an executable, this file does not by itself cause the
+// resulting executable to be covered by the GNU General Public
+// License.  This exception does not however invalidate any other
+// reasons why the executable file might be covered by the GNU General
+// Public License.
+// Benjamin Kosnik  <bkoz@redhat.com>
+
+#include <ios>
+#include <testsuite_hooks.h>
+
+int main()
+{
+  __gnu_test::bitmask_operators<std::ios_base::iostate>();
+};
diff --git a/libstdc++-v3/testsuite/27_io/ios_base/types/iostate/case_label.cc b/libstdc++-v3/testsuite/27_io/ios_base/types/iostate/case_label.cc
new file mode 100644 (file)
index 0000000..51277c9
--- /dev/null
@@ -0,0 +1,56 @@
+// { dg-do compile }
+// { dg-options "-Wall" { target *-*-* } }
+// -*- C++ -*-
+// Copyright (C) 2004 Free Software Foundation, Inc.
+// 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, 59 Temple Place - Suite 330, Boston,
+// MA 02111-1307, USA.
+// As a special exception, you may use this file as part of a free
+// software library without restriction.  Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to
+// produce an executable, this file does not by itself cause the
+// resulting executable to be covered by the GNU General Public
+// License.  This exception does not however invalidate any other
+// reasons why the executable file might be covered by the GNU General
+// Public License.
+// Benjamin Kosnik  <bkoz@redhat.com>
+
+#include <ios>
+
+// PR libstdc++/17922
+// -Wall
+typedef std::ios_base::iostate bitmask_type;
+
+void
+case_labels(bitmask_type b)
+{
+  switch (b) 
+    {
+    case std::ios_base::goodbit:
+      break;
+    case std::ios_base::badbit:
+      break;
+    case std::ios_base::eofbit:
+      break;
+    case std::ios_base::failbit:
+      break;
+    case std::_S_ios_iostate_end:
+      break;
+    }
+}
diff --git a/libstdc++-v3/testsuite/27_io/ios_base/types/openmode/bitmask_operators.cc b/libstdc++-v3/testsuite/27_io/ios_base/types/openmode/bitmask_operators.cc
new file mode 100644 (file)
index 0000000..457b6dd
--- /dev/null
@@ -0,0 +1,39 @@
+// { dg-do compile }
+// -*- C++ -*-
+// Copyright (C) 2004 Free Software Foundation, Inc.
+// 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, 59 Temple Place - Suite 330, Boston,
+// MA 02111-1307, USA.
+// As a special exception, you may use this file as part of a free
+// software library without restriction.  Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to
+// produce an executable, this file does not by itself cause the
+// resulting executable to be covered by the GNU General Public
+// License.  This exception does not however invalidate any other
+// reasons why the executable file might be covered by the GNU General
+// Public License.
+// Benjamin Kosnik  <bkoz@redhat.com>
+
+#include <ios>
+#include <testsuite_hooks.h>
+
+int main()
+{
+  __gnu_test::bitmask_operators<std::ios_base::openmode>();
+};
diff --git a/libstdc++-v3/testsuite/27_io/ios_base/types/openmode/case_label.cc b/libstdc++-v3/testsuite/27_io/ios_base/types/openmode/case_label.cc
new file mode 100644 (file)
index 0000000..4287550
--- /dev/null
@@ -0,0 +1,60 @@
+// { dg-do compile }
+// { dg-options "-Wall" { target *-*-* } }
+// -*- C++ -*-
+// Copyright (C) 2004 Free Software Foundation, Inc.
+// 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, 59 Temple Place - Suite 330, Boston,
+// MA 02111-1307, USA.
+// As a special exception, you may use this file as part of a free
+// software library without restriction.  Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to
+// produce an executable, this file does not by itself cause the
+// resulting executable to be covered by the GNU General Public
+// License.  This exception does not however invalidate any other
+// reasons why the executable file might be covered by the GNU General
+// Public License.
+// Benjamin Kosnik  <bkoz@redhat.com>
+
+#include <ios>
+
+// PR libstdc++/17922
+// -Wall
+typedef std::ios_base::openmode bitmask_type;
+
+void
+case_labels(bitmask_type b)
+{
+  switch (b) 
+    {
+    case std::ios_base::app:
+      break;
+    case std::ios_base::ate:
+      break;
+    case std::ios_base::binary:
+      break;
+    case std::ios_base::in:
+      break;
+    case std::ios_base::out:
+      break;
+    case std::ios_base::trunc:
+      break;
+    case std::_S_ios_openmode_end:
+      break;
+    }
+}
diff --git a/libstdc++-v3/testsuite/27_io/ios_base/types/seekdir/case_label.cc b/libstdc++-v3/testsuite/27_io/ios_base/types/seekdir/case_label.cc
new file mode 100644 (file)
index 0000000..0769758
--- /dev/null
@@ -0,0 +1,54 @@
+// { dg-do compile }
+// { dg-options "-Wall" { target *-*-* } }
+// -*- C++ -*-
+// Copyright (C) 2004 Free Software Foundation, Inc.
+// 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, 59 Temple Place - Suite 330, Boston,
+// MA 02111-1307, USA.
+// As a special exception, you may use this file as part of a free
+// software library without restriction.  Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to
+// produce an executable, this file does not by itself cause the
+// resulting executable to be covered by the GNU General Public
+// License.  This exception does not however invalidate any other
+// reasons why the executable file might be covered by the GNU General
+// Public License.
+// Benjamin Kosnik  <bkoz@redhat.com>
+
+#include <ios>
+
+// PR libstdc++/17922
+// -Wall
+typedef std::ios_base::seekdir test_type;
+
+void
+case_labels(test_type b)
+{
+  switch (b) 
+    {
+    case std::ios_base::beg:
+      break;
+    case std::ios_base::cur:
+      break;
+    case std::ios_base::end:
+      break;
+    case std::_S_ios_fmtflags_end:
+      break;
+    }
+}
index 1919ab8..4b526e9 100644 (file)
@@ -103,6 +103,23 @@ namespace __gnu_test
   void
   verify_demangle(const char* mangled, const char* wanted);
 
+  // 17.3.2.1.2 - Bitmask types [lib.bitmask.types]
+  // bitmask_operators
+  template<typename bitmask_type>
+    void
+    bitmask_operators()
+    {
+      bitmask_type a;
+      bitmask_type b;
+      a | b;
+      a & b;
+      a ^ b;
+      ~b;
+      a |= b; // set
+      a &= ~b; // clear
+      a ^= b;
+    }
+
   // Simple callback structure for variable numbers of tests (all with
   // same signature).  Assume all unit tests are of the signature
   // void test01();