Summary: | ios_base should replace operator void* with explicit operator bool in C++11 onwards. | ||
---|---|---|---|
Product: | gcc | Reporter: | Ed Smith-Rowland <3dw4rd> |
Component: | libstdc++ | Assignee: | Not yet assigned to anyone <unassigned> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | daniel.kruegler |
Priority: | P3 | ||
Version: | 4.8.0 | ||
Target Milestone: | 5.0 | ||
Host: | Target: | ||
Build: | Known to work: | ||
Known to fail: | Last reconfirmed: | 2013-02-03 00:00:00 | |
Attachments: | Patch including testcase. |
Description
Ed Smith-Rowland
2013-02-03 16:30:37 UTC
Created attachment 29343 [details]
Patch including testcase.
Here is a small patch. I'm not ure the bast place to put the testcase.
Testing is underway.
The change builds and fails to compile the testcase as expected on x86_64-unknown-linux.
Author: paolo Date: Mon Feb 11 10:30:43 2013 New Revision: 195939 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=195939 Log: 2013-02-11 Paolo Carlini <paolo.carlini@oracle.com> PR libstdc++/56282 Revert: 2013-02-06 Edward Smith-Rowland <3dw4rd@verizon.net> PR libstdc++/56193 * include/bits/basic_ios.h: Replace operator void*() const with explicit operator bool() const in C++11 and greater. * testsuite/27_io/basic_ios/pr56193.cc: New file. Removed: trunk/libstdc++-v3/testsuite/27_io/basic_ios/pr56193.cc Modified: trunk/libstdc++-v3/ChangeLog trunk/libstdc++-v3/include/bits/basic_ios.h Patch reverted. Better simply do this in the next ABI. PR 56282 has a patch that could serve as a starting point for the symbol versions file Indeed, thanks Jon. Ping. @Paolo, any ETA for this entering a trunk? ping 2014. I just noticed the same problem that in C++11 code (and beyond) the following code compiles due to the existence of the implicit conversion to void*: #include <iostream> bool test = (std::cout == std::cerr); It will be ready when it's ready - there are bigger issues that are higher priority (In reply to Jonathan Wakely from comment #9) Yes, sure. Author: redi Date: Wed Sep 24 22:13:35 2014 New Revision: 215571 URL: https://gcc.gnu.org/viewcvs?rev=215571&root=gcc&view=rev Log: PR libstdc++/56193 * config/abi/pre/gnu.ver: Add new exports. * include/bits/basic_ios.h (basic_ios::operator bool): Define. * src/c++98/ios_locale.cc (basic_ios::operator void*): Instantiate. Modified: trunk/libstdc++-v3/ChangeLog trunk/libstdc++-v3/config/abi/pre/gnu.ver trunk/libstdc++-v3/include/bits/basic_ios.h trunk/libstdc++-v3/src/c++98/ios_locale.cc Fixed. |