This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [v3] Less noexcept
- From: Paolo Carlini <paolo dot carlini at oracle dot com>
- To: Marc Glisse <marc dot glisse at inria dot fr>
- Cc: libstdc++ at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Mon, 23 Sep 2013 14:36:54 -0500
- Subject: Re: [v3] Less noexcept
- Authentication-results: sourceware.org; auth=none
- References: <alpine dot DEB dot 2 dot 10 dot 1309231727470 dot 4526 at stedding dot saclay dot inria dot fr> <52406C81 dot 3010106 at oracle dot com> <alpine dot DEB dot 2 dot 10 dot 1309231947130 dot 4088 at laptop-mg dot saclay dot inria dot fr>
Hi,
On 9/23/13 2:23 PM, Marc Glisse wrote:
On Mon, 23 Sep 2013, Paolo Carlini wrote:
On 9/23/13 10:55 AM, Marc Glisse wrote:
Hello,
this patch was tested on x86_64 with a bootstrap and a simple make
-k check, without regression. Note that it doesn't completely fix
56166, it
merely admits that we may currently throw and avoids turning that into
std::terminate.
Of course.
Patch basically Ok, can you be a little less terse in the comments
before the noexcepts which you are removing and in fact must be there
for conformance, aren't just QoI? Point to an existing bug, when it
exists, like 56166, add a FIXME C++11 at least.
Like this?
Yes.
It is funny that with fully dynamic strings, the copy constructor is
"better" than the move constructor: faster, doesn't throw, etc. I
think we should remove the move constructor in that case, or at least
make it act the same as the copy constructor. I didn't mark the copy
constructor as noexcept, but without checking the code it seems likely
we could.
We could, but in my opinion fiddling with those isn't worth the trouble,
because the whole "fully dynamic string" thing is just a workaround for
issues of the current reference counted implementation vs the statically
allocated empty string on some targets.
Also, __versa_string actually has the same issues as basic_string, if
you choose the reference counted base...
Indeed, that's known. That base can't implement the C++11 specs, not
surprising because it predates those by many years, when reference
counted implementations weren't ruled out by the working draft. At that
time I found it useful anyway to compare performance (without the burden
of the alignment issues of our normal reference counted implementation)
I guess I have to do a patch to remove noexcept there now :-(
I would recommend not wasting time on that right now. Really eventually
we'll only have the short-string-optimized version as our string
implementation.
Has someone started work on some branch to get a real C++11
basic_string, or are we waiting until the "lack of manpower" argument
convinces everyone to forget about trying to preserve any ABI
compatibility?
It's just versa_string with fixed short-string-optimized base. It will
replace basic_string when we break the ABI, that is, probably in the
next release series, when the new ABI checking framework will be ready
(if you are curious about it, you can find a talk in the material of the
last Cauldron, by Benjamin, Jason, Dodji)
Thanks,
Paolo.