mirrored from git://gcc.gnu.org/git/gcc.git
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
P0935R0 Eradicating unnecessarily explicit default constructors
This is the last remaining piece of P0935R0. This adds a default constructor to each of the streambuf and stream types in <sstream> so that default construction does not use the 'explicit' constructor that has a single, defaulted argument. P0935R0 Eradicating unnecessarily explicit default constructors * config/abi/pre/gnu.ver: Tighten existing patterns and export new default constructor symbols. * include/std/sstream (basic_stringbuf, basic_istringstream) (basic_ostringstream, basic_stringstream): Remove default arguments from explicit constructors taking ios_base::openmode and add separate non-explicit default constructors. * testsuite/27_io/basic_istringstream/cons/default.cc: New. * testsuite/27_io/basic_ostringstream/cons/default.cc: New. * testsuite/27_io/basic_stringstream/cons/default.cc: New. * testsuite/27_io/basic_stringbuf/cons/char/default.cc: New. * testsuite/27_io/basic_stringbuf/cons/wchar_t/default.cc: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@262474 138bc75d-0d04-0410-961f-82ee72b054a4
- Loading branch information
redi
committed
Jul 6, 2018
1 parent
a01fc43
commit 8cffd3e
Showing
8 changed files
with
269 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,18 @@ | ||
2018-07-06 Jonathan Wakely <[email protected]> | ||
|
||
P0935R0 Eradicating unnecessarily explicit default constructors | ||
* config/abi/pre/gnu.ver: Tighten existing patterns and export new | ||
default constructor symbols. | ||
* include/std/sstream (basic_stringbuf, basic_istringstream) | ||
(basic_ostringstream, basic_stringstream): Remove default arguments | ||
from explicit constructors taking ios_base::openmode and add separate | ||
non-explicit default constructors. | ||
* testsuite/27_io/basic_istringstream/cons/default.cc: New. | ||
* testsuite/27_io/basic_ostringstream/cons/default.cc: New. | ||
* testsuite/27_io/basic_stringstream/cons/default.cc: New. | ||
* testsuite/27_io/basic_stringbuf/cons/char/default.cc: New. | ||
* testsuite/27_io/basic_stringbuf/cons/wchar_t/default.cc: New. | ||
|
||
* include/std/variant (__accepted_index): Use void_t. | ||
|
||
2018-07-05 Jonathan Wakely <[email protected]> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
libstdc++-v3/testsuite/27_io/basic_istringstream/cons/default.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// Copyright (C) 2018 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/>. | ||
|
||
// C++11 27.8.3.1 basic_istringstream constructors [istringstream.cons] | ||
|
||
// { dg-do run { target c++11 } } | ||
|
||
#include <sstream> | ||
#include <testsuite_common_types.h> | ||
|
||
void test01() | ||
{ | ||
// P0935R0 | ||
__gnu_test::implicitly_default_constructible test; | ||
test.operator()<std::istringstream>(); | ||
} | ||
|
||
int main() | ||
{ | ||
test01(); | ||
} |
35 changes: 35 additions & 0 deletions
35
libstdc++-v3/testsuite/27_io/basic_ostringstream/cons/default.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// Copyright (C) 2018 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/>. | ||
|
||
// C++11 27.8.4.1 basic_ostringstream constructors [ostringstream.cons] | ||
|
||
// { dg-do run { target c++11 } } | ||
|
||
#include <sstream> | ||
#include <testsuite_common_types.h> | ||
|
||
void test01() | ||
{ | ||
// P0935R0 | ||
__gnu_test::implicitly_default_constructible test; | ||
test.operator()<std::ostringstream>(); | ||
} | ||
|
||
int main() | ||
{ | ||
test01(); | ||
} |
35 changes: 35 additions & 0 deletions
35
libstdc++-v3/testsuite/27_io/basic_stringbuf/cons/char/default.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// Copyright (C) 2018 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/>. | ||
|
||
// C++11 27.8.2.1 basic_stringbuf constructors [stringbuf.cons] | ||
|
||
// { dg-do run { target c++11 } } | ||
|
||
#include <sstream> | ||
#include <testsuite_common_types.h> | ||
|
||
void test01() | ||
{ | ||
// P0935R0 | ||
__gnu_test::implicitly_default_constructible test; | ||
test.operator()<std::stringbuf>(); | ||
} | ||
|
||
int main() | ||
{ | ||
test01(); | ||
} |
35 changes: 35 additions & 0 deletions
35
libstdc++-v3/testsuite/27_io/basic_stringbuf/cons/wchar_t/default.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// Copyright (C) 2018 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/>. | ||
|
||
// C++11 27.8.2.1 basic_stringbuf constructors [stringbuf.cons] | ||
|
||
// { dg-do run { target c++11 } } | ||
|
||
#include <sstream> | ||
#include <testsuite_common_types.h> | ||
|
||
void test01() | ||
{ | ||
// P0935R0 | ||
__gnu_test::implicitly_default_constructible test; | ||
test.operator()<std::wstringbuf>(); | ||
} | ||
|
||
int main() | ||
{ | ||
test01(); | ||
} |
35 changes: 35 additions & 0 deletions
35
libstdc++-v3/testsuite/27_io/basic_stringstream/cons/default.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// Copyright (C) 2018 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/>. | ||
|
||
// C++11 27.8.5.1 basic_stringstream constructors [stringstream.cons] | ||
|
||
// { dg-do run { target c++11 } } | ||
|
||
#include <sstream> | ||
#include <testsuite_common_types.h> | ||
|
||
void test01() | ||
{ | ||
// P0935R0 | ||
__gnu_test::implicitly_default_constructible test; | ||
test.operator()<std::stringstream>(); | ||
} | ||
|
||
int main() | ||
{ | ||
test01(); | ||
} |