diff options
author | paolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-12-24 18:12:02 +0000 |
---|---|---|
committer | paolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-12-24 18:12:02 +0000 |
commit | 3379a5412a1429cfe4c6806dd496ac2ba04e9bdc (patch) | |
tree | e03de1e9b02147e3164675b91b695f4038290978 /libstdc++-v3/testsuite/23_containers | |
parent | d122acaf684ecc89723441b04f5ff2bb54e59ef3 (diff) | |
download | gcc-3379a5412a1429cfe4c6806dd496ac2ba04e9bdc.tar.gz |
2009-12-24 Edward Smith-Rowland <3dw4rd@verizon.net>
Paolo Carlini <paolo.carlini@oracle.com>
* include/std/bitset (bitset<>::bitset(const char*)): Add.
2009-12-24 Jonathan Wakely <jwakely.gcc@gmail.com>
Edward Smith-Rowland <3dw4rd@verizon.net>
* testsuite/23_containers/bitset/cons/2.cc: New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@155458 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/testsuite/23_containers')
-rw-r--r-- | libstdc++-v3/testsuite/23_containers/bitset/cons/2.cc | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/libstdc++-v3/testsuite/23_containers/bitset/cons/2.cc b/libstdc++-v3/testsuite/23_containers/bitset/cons/2.cc new file mode 100644 index 00000000000..a1b9c649c9d --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/bitset/cons/2.cc @@ -0,0 +1,46 @@ +// { dg-options "-std=gnu++0x" } + +// Copyright (C) 2009 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 3, 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 COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +#include <bitset> +#include <string> +#include <testsuite_hooks.h> + +struct X +{ + operator const char*() { return "10101010"; } +}; + +void +test01() +{ + bool test __attribute__((unused)) = true; + + X x; + std::string s(x); + std::bitset<32> b1(x); + std::bitset<32> b2(s); + VERIFY( b1 == b2 ); +} + +int +main() +{ + test01(); + return 0; +} |