Jonathan Wakely | 29 Oct 19:40 2014

[patch] Use perfect forwarding in std::function's invokers

As pointed out in our
std::function does more copying/moving than necessary. The solution is
to use perfect forwarding for the internal invoker functions, even if
function<R(Args...)::operator() and the target function take their
arguments by value.

Tested x86_64-linux, committed to trunk.
Attachment (patch.txt): text/x-patch, 5170 bytes
Jonathan Wakely | 23 Oct 18:55 2014

[patch] Update libstdc++ status docs

Committed to trunk.
Attachment (patch.txt): text/x-patch, 2282 bytes
Tim Shen | 22 Oct 19:55 2014

Re: [patch] LWG 2019 - std::isblank<C>(C, const std::locale&)

On Tue, Oct 21, 2014 at 4:15 PM, Jonathan Wakely <jwakely.gcc <at>> wrote:
> The example  implementation shows that "w" needs special handling to match
> underscore as well as the members of the alnum class.

Oh sorry for missing that; then the change looks good to me.


Tim Shen

Damian Lezama | 22 Oct 17:40 2014

std thread,mutex,cv and static linking with GCC


I was getting random crashes when using thread, mutex, and cv and statically linking my project. Some of the
libraries I link against use pthread, so I narrowed the issue down to this test:

I statically link a simple test that uses thread, mutex, and cv like this: "g++ --std=c++11 -pthread
-static" and  I get this when I run it:

terminate called after throwing an instance of 'std::system_error'
  what():  Enable multithreading to use std::thread: Operation not permitted

Everything works fine if I don't use -static, the problem is specific to static linking. If in my test I use
pthread directly to create a thread, then it runs and creating an std::thread also works, but the test
crashes when using the cv. My theory is that the linker is being lazy (weak references? optimization?) and
the pthread stuff std needs is not included in the binary unless referenced somewhere else. In real
projects this is quite dangerous because having dependencies that use most of the pthread stuff makes
these crashes rare (I caught this problem with a stress test).

Any ideas? Is this s bug in the library?


Jonathan Wakely | 22 Oct 15:42 2014

Re: [patch] LWG 2019 - std::isblank<C>(C, const std::locale&)

Re-sending as plain text ...

On 22 October 2014 00:15, Jonathan Wakely <jwakely.gcc <at>> wrote:
> On Oct 21, 2014 6:33 PM, "Tim Shen" <timshen <at>> wrote:
>> On Tue, Oct 21, 2014 at 5:26 AM, Jonathan Wakely <jwakely <at>>
>> wrote:
>> > I don't think we can remove _RegexMask entirely, as we still need
>> > special handling for the "w" class, so maybe something like the
>> > attached.
>> >
>> > Alternatively we could replace _M_extended with bool _M_under and not
>> > need to do any bitwise operations like _M_extended & _S_valid_mask.
>> I didn't take a deep look, so I'm probably wrong, but
>> <> says that "w"
>> 's Corresponding ctype_base::mask value is ctype_base::alnum and,
>> everyone in Table X has its own builtin mask value.
> The example  implementation shows that "w" needs special handling to match
> underscore as well as the members of the alnum class.
>> Also, I use n3376 when I implemented this. I suppose we should update
>> it to the latest version?
> I don't think there are many changes in clause 28 but it would be good to
> check.

(Continue reading)

François Dumont | 17 Oct 22:46 2014

[Bug libstdc++/61107] stl_algo.h: std::__inplace_stable_partition() doesn't process the whole data range


     As proposed in the bug report I just removed the 
__inplace_stable_partition as __stable_partition_adaptive is able to 
handle a 0 buffer size.

     To test this bug I introduced overloads of new/delete operators in 
the testsuite utils. The existing set_memory_limits has no impact on new 
operator. I wonder if some test using it really have the expected behavior.

     I also tests other algos that try to use a buffer and didn't found 
any issue. Those algos however can't be simplified like stable_partition.

2014-10-16  François Dumont <fdumont <at>>

     PR libstdc++/61107
     * include/bits/stl_algo.h (__inplace_stable_partition): Delete.
     (__stable_partition): Adapt.
     * testsuite/util/testsuite_new_operators.h: New.
     * testsuite/25_algorithms/stable_sort/ Test algo in simulated
     constraint memory context.
     * testsuite/25_algorithms/inplace_merge/ Likewise.
     * testsuite/25_algorithms/stable_partition/ Likewise.

Tested under Linux x86_64.

Ok to commit ?

(Continue reading)

Jonathan Wakely | 17 Oct 14:34 2014

[wwwdocs] Add recent C++ changes to gcc-5/changes.html

Committed to CVS.
Attachment (patch.txt): text/x-patch, 3947 bytes
Paolo Carlini | 15 Oct 23:10 2014

[v3] Update a testcase vs c++/53000


contributed by Daniel. Thanks!


2014-10-15  Daniel Krugler  <daniel.kruegler <at>>

	* testsuite/20_util/common_type/requirements/
	Enable tests predicated on PR c++/53000.

Index: testsuite/20_util/common_type/requirements/
--- testsuite/20_util/common_type/requirements/	(revision 216284)
+++ testsuite/20_util/common_type/requirements/	(working copy)
 <at>  <at>  -21,9 +21,6  <at>  <at> 
 #include <type_traits>
 #include <initializer_list>

-//TODO: Uncomment this once gcc bug 53000 has been resolved:
-//#define HAS_53000_FIXED
 // Helper types:
 struct has_type_impl
(Continue reading)

Jonathan Wakely | 15 Oct 15:20 2014

[patch] Add missing 'const' to std::complex primary template

Some more constexpr members that need to be 'const' in C++14.

Tested x86_64-linux, committed to trunk.

Attachment (patch.txt): text/x-patch, 2232 bytes
John Schmerge | 15 Oct 05:15 2014

Missing codecvt specializations and <codecvt> header and a request for some guidance

Hi guys,

I'm looking for some guidance. As part of implementing a version of
the std::filesystem proposal, I've needed to flesh out pieces of the
missing codecvt classes for the standard library.

Right now, I have a poorly organized version of the codecvt
specializations for char16_t and char32_t and a version of
codecvt_utf8 up on github (and should have the
codecvt_utf16/utf8_utf16 classes in a workable state in a few days).

I'd like to contribute this code to libstdc++ when its complete, and
I'm at a bit of a loss as to what the best way to go about that might
be. Any thoughts on how to do so would be appreciated.

You can find the code I'm speaking of here:


François Dumont | 14 Oct 23:51 2014

[Bug libstdc++/63500] [4.9/5 Regression] bug in debug version of std::make_move_iterator?


     Here is a proposal to fix the issue with iterators which do not 
expose lvalue references when dereferenced. I simply chose to detect 
such an issue in c++11 mode thanks to the is_lvalue_reference meta function.

2014-10-15  François Dumont  <fdumont <at>>

     PR libstdc++/63500
     * include/bits/cpp_type_traits.h (__true_type): Add __value constant.
     (__false_type): Likewise.
     * include/debug/functions.h (__foreign_iterator_aux2): Do not check for
     foreign iterators if input iterators returns rvalue reference.
     * testsuite/23_containers/vector/ New.

Tested under Linux x86_64.


Attachment (debug.patch): text/x-patch, 3237 bytes