From bd80bd9b93b62fa5388caac9e7adf33c05de52be Mon Sep 17 00:00:00 2001 From: Benjamin Kosnik Date: Tue, 2 Nov 2004 19:00:19 +0000 Subject: [PATCH] re PR libstdc++/17922 (Spurious warnings about std::ios_base::seekdir) 2004-11-02 Benjamin Kosnik 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. From-SVN: r89996 --- libstdc++-v3/ChangeLog | 19 +++++ libstdc++-v3/config/io/c_io_stdio.h | 3 +- libstdc++-v3/include/bits/ios_base.h | 69 ++++++++++++--- libstdc++-v3/src/ios.cc | 5 +- .../27_io/ios_base/cons/assign_neg.cc | 2 +- .../testsuite/27_io/ios_base/cons/copy_neg.cc | 2 +- .../types/fmtflags/bitmask_operators.cc | 39 +++++++++ .../ios_base/types/fmtflags/case_label.cc | 84 +++++++++++++++++++ .../types/iostate/bitmask_operators.cc | 39 +++++++++ .../ios_base/types/iostate/case_label.cc | 56 +++++++++++++ .../types/openmode/bitmask_operators.cc | 39 +++++++++ .../ios_base/types/openmode/case_label.cc | 60 +++++++++++++ .../ios_base/types/seekdir/case_label.cc | 54 ++++++++++++ libstdc++-v3/testsuite/testsuite_hooks.h | 17 ++++ 14 files changed, 470 insertions(+), 18 deletions(-) create mode 100644 libstdc++-v3/testsuite/27_io/ios_base/types/fmtflags/bitmask_operators.cc create mode 100644 libstdc++-v3/testsuite/27_io/ios_base/types/fmtflags/case_label.cc create mode 100644 libstdc++-v3/testsuite/27_io/ios_base/types/iostate/bitmask_operators.cc create mode 100644 libstdc++-v3/testsuite/27_io/ios_base/types/iostate/case_label.cc create mode 100644 libstdc++-v3/testsuite/27_io/ios_base/types/openmode/bitmask_operators.cc create mode 100644 libstdc++-v3/testsuite/27_io/ios_base/types/openmode/case_label.cc create mode 100644 libstdc++-v3/testsuite/27_io/ios_base/types/seekdir/case_label.cc diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 4e6167227ef..0b0545302f5 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,22 @@ +2004-11-02 Benjamin Kosnik + + 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 PR libstdc++/18185 diff --git a/libstdc++-v3/config/io/c_io_stdio.h b/libstdc++-v3/config/io/c_io_stdio.h index c9ae4322171..5659c139730 100644 --- a/libstdc++-v3/config/io/c_io_stdio.h +++ b/libstdc++-v3/config/io/c_io_stdio.h @@ -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 { diff --git a/libstdc++-v3/include/bits/ios_base.h b/libstdc++-v3/include/bits/ios_base.h index eb97a49e426..2855b5ba2f1 100644 --- a/libstdc++-v3/include/bits/ios_base.h +++ b/libstdc++-v3/include/bits/ios_base.h @@ -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(__a) ^ static_cast(__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(__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(__a) ^ static_cast(__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(__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(__a) ^ static_cast(__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(__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 /** diff --git a/libstdc++-v3/src/ios.cc b/libstdc++-v3/src/ios.cc index 09b292916f1..70b22f67e64 100644 --- a/libstdc++-v3/src/ios.cc +++ b/libstdc++-v3/src/ios.cc @@ -37,8 +37,9 @@ #include 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; diff --git a/libstdc++-v3/testsuite/27_io/ios_base/cons/assign_neg.cc b/libstdc++-v3/testsuite/27_io/ios_base/cons/assign_neg.cc index ca3e3c97a4d..50c8eb8b05f 100644 --- a/libstdc++-v3/testsuite/27_io/ios_base/cons/assign_neg.cc +++ b/libstdc++-v3/testsuite/27_io/ios_base/cons/assign_neg.cc @@ -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 } diff --git a/libstdc++-v3/testsuite/27_io/ios_base/cons/copy_neg.cc b/libstdc++-v3/testsuite/27_io/ios_base/cons/copy_neg.cc index 013138d874b..925087d5b27 100644 --- a/libstdc++-v3/testsuite/27_io/ios_base/cons/copy_neg.cc +++ b/libstdc++-v3/testsuite/27_io/ios_base/cons/copy_neg.cc @@ -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 index 00000000000..4f16d15cddb --- /dev/null +++ b/libstdc++-v3/testsuite/27_io/ios_base/types/fmtflags/bitmask_operators.cc @@ -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 + +#include +#include + +int main() +{ + __gnu_test::bitmask_operators(); +}; 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 index 00000000000..3c4e6af233c --- /dev/null +++ b/libstdc++-v3/testsuite/27_io/ios_base/types/fmtflags/case_label.cc @@ -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 + +#include + +// 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 index 00000000000..c8a00a0a272 --- /dev/null +++ b/libstdc++-v3/testsuite/27_io/ios_base/types/iostate/bitmask_operators.cc @@ -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 + +#include +#include + +int main() +{ + __gnu_test::bitmask_operators(); +}; 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 index 00000000000..51277c9d073 --- /dev/null +++ b/libstdc++-v3/testsuite/27_io/ios_base/types/iostate/case_label.cc @@ -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 + +#include + +// 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 index 00000000000..457b6dd01e1 --- /dev/null +++ b/libstdc++-v3/testsuite/27_io/ios_base/types/openmode/bitmask_operators.cc @@ -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 + +#include +#include + +int main() +{ + __gnu_test::bitmask_operators(); +}; 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 index 00000000000..42875502451 --- /dev/null +++ b/libstdc++-v3/testsuite/27_io/ios_base/types/openmode/case_label.cc @@ -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 + +#include + +// 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 index 00000000000..076975815e3 --- /dev/null +++ b/libstdc++-v3/testsuite/27_io/ios_base/types/seekdir/case_label.cc @@ -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 + +#include + +// 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; + } +} diff --git a/libstdc++-v3/testsuite/testsuite_hooks.h b/libstdc++-v3/testsuite/testsuite_hooks.h index 1919ab8a114..4b526e9b19f 100644 --- a/libstdc++-v3/testsuite/testsuite_hooks.h +++ b/libstdc++-v3/testsuite/testsuite_hooks.h @@ -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 + 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(); -- 2.30.2