Jonathan Wakely | 24 Mar 15:39 2015

[patch] libstdc++/33394 add testcase

Adding a testcase so the bug can be closed.

I believe the segfault was fixed for 3.4.0 by

Tested x86_64-linux, committed to trunk.

Attachment (patch.txt): text/x-patch, 2187 bytes
Fan You | 24 Mar 09:38 2015

[GSoC] Update on extend shared_ptr to support array


Here is a quick update of my work on extend shared_ptr to support
array.(Finished basic constructor/function, weak_ptr support) I am
getting familiar with libstdc++, and I'm trying to follow the coding
style as close as possible. If there is any problems, please let me
know! :-)

Also, I have few questions:

1. For all those entries list here
do I need to implement them one by one into <experimental/memory>? Or,
for those entries that can still be apply to shared_ptr array with no
problem, can I just use them by including <memory> ?

2. Do I need to do a specialization for weak_ptr in shared_ptr_base.h
to support shared_ptr_array? Even though the proposal didn't talk
about it, I think it's necessary and I also made a few attempts on it.
(its shown in the attachment)

diff --git a/bits/shared_ptr_base.h b/bits/shared_ptr_base.h
index 026c597..b552d3b 100644
--- a/bits/shared_ptr_base.h
+++ b/bits/shared_ptr_base.h
 <at>  <at>  -1,3 +1,5  <at>  <at> 
+#include <iostream>
(Continue reading)

Jonathan Wakely | 23 Mar 15:51 2015

gnu-versioned-namespace and <experimental/xxx> headers

The <experimental/xxx> TS headers start with some set of namespaces

namespace std _GLIBCXX_VISIBILITY(default)
namespace experimental
inline namespace fundamentals_v1

where the macro either expands to nothing, or with
--enable-symvers=gnu-versioned-namespace to:

namespace __7 {

The problem is that __7 is not declared as inline. In
<bits/c++config.h> we have:

  namespace experimental { inline namespace __7 { } }

But that declares std::experimental::__7 as inline rather than
std::experimental::fundamentals_v1::__7. (Also, it declares
'experimental' unconditionally which makes it a reserved name, but
users should be able to use it for macros unless they include an
<experimental/xxx> header).

This means that all the testsuite/experimental/* tests fail with
gnu-versioned-namespace because there is no such type as
std::experimental::optional, only std::experimental::__7::optional.
(Continue reading)

Fan You | 19 Mar 07:36 2015

[GSoC] Proposal for GSoC 2015


It's Fan You. I follow the guideline on
<> and finished my first version
of proposal. Is it clear and realistic?


The Project:
	Extending shared_ptr to support arrays && Polymorphic memory resources

The Goal:
	*Extend shared_ptr to support arrays
		-By Syntax shared_ptr<_T[]> or shared_ptr<_T[N]>
		-New feature are written in shared_ptr_base.h and can be used by include<experimental/memory>
	*Polymorphic memory resources
		-Erase allocator from the container's type
		-New namespace and memory_resources management Classes

	*March 27 - April 27
		-Continue working on shared_ptr,communicate with the community, read shared_ptr source code, get
familiar with gcc coding and document style.
		-Try implement major part of the shared_ptr array support.
	*April 28 - May 25
		-Do test, fixing and improvements on shared_ptr array support and hopefully finalize it.
		-Communicate with mentor, design the detail of implementing memory resources classes.
(Continue reading)

Jonathan Wakely | 18 Mar 19:16 2015

[patch] c++/65046 Use abi-tag to fix building with -Werror=abi-tag

This adds the abi_tag attribute in a few places it's missing, so that
-Werror=abi-tag builds will work after Jason's upcoming patches to
make functions inherit the tag from their return type.

For the __sso_string type I disable the warning, because the fact it
uses std::__cxx11::string internally is not visible to users.

There are still some missing tags in the Debug Mode string and list
which I'll fix asap.

Preparing this patch reminded me that we currently have two copies of
the Catalog_info and Catalogs code in the unnamed namespace in
config/locale/gnu/, one using the old string and
one using the new. We should really alter the code to not use
std::string so that the catalogs can be shared by both versions of the
messages facets.

Tested x86_64-linux, as a standard build, and also with Jason's WIP
patches and --enable-cxx-flags=-Werror=abi-tag.

Committed to trunk.

Attachment (patch.txt): text/x-patch, 7867 bytes
Jonathan Wakely | 17 Mar 17:36 2015

[patch] Remove duplicate libstdc++ tests

I noticed that testsuite/30_threads/shared_lock/modifiers/ is
almost identical to in the same directory, except for the diff
shown in the attached patch. That file was copied from
testsuite/30_threads/unique_lock/modifiers/ which is almost
identical to in that directory.

So I'm applying the attached patch to remove the unused variable name,
and deleting the duplicate tests.

Tested x86_64-linux, committed to trunk.

Attachment (patch.txt): text/x-patch, 1461 bytes
Fan You | 16 Mar 20:14 2015

[GSoC] Extend shared_ptr to support arrays


It's my simple version of extending shared_ptr to support arrays, am I
in the right direction?

When I do the boundary checking, when user try to access elements that
are out of boundary, should I throw an exception or just use assert to
avoid that from happening? (I saw boost use BOOST_ASSERT to do that)

Next, my plan for GSoC is to finish shared_ptr_array_support first and
then choose one or two from other TS.

For those TS I am looking into:

- Invocation type traits
  I have a very limited compiler knowledge, so I am still learning it.

- Polymorphic Memory Resources
  After reading the proposal
<>, I
am still not quite sure about the idea of Polymorphic memory
resources. The example on page 5 make sense to me, but what's the key
different between the original memory allocation method and this? Any
other resource that I can read from?

- Networking TS
  I get the wrong link last time, but I find it myself(don't know if
it's correct <>).
The proposal intend to implement a whole Network Library and it's
currently too big for me to read them all. Can you suggest a specific
(Continue reading)

Tim Shen | 15 Mar 09:09 2015

[Patch, libstdc++/65420] Use constexpr variables as regex_constans flags

Did a little bit refectoring on regex_constants, so that users won't
be polluted too much (they are not enum types anymore).

Bootstrapped and tested.


Tim Shen
commit 5cd86b408ef0a9cba1a21a3018c797d9e245d158
Author: Tim Shen <timshen <at>>
Date:   Sat Mar 14 23:05:05 2015 -0700

    	PR libstdc++/65420
    	* include/bits/regex.h: Add definition for static constexpr variables.
    	* include/bits/regex_constants.h: Change flags to constexpr variables.

diff --git a/libstdc++-v3/include/bits/regex.h b/libstdc++-v3/include/bits/regex.h
index a23c2c9..99ac973 100644
--- a/libstdc++-v3/include/bits/regex.h
+++ b/libstdc++-v3/include/bits/regex.h
 <at>  <at>  -782,6 +782,46  <at>  <at>  _GLIBCXX_BEGIN_NAMESPACE_CXX11
       _AutomatonPtr          _M_automaton;

+  template<typename _Ch_type, typename _Rx_traits>
+    constexpr regex_constants::syntax_option_type
(Continue reading)

Jonathan Wakely | 10 Mar 20:23 2015

[patch] Use --enable-libstdcxx-time=yes on DragonFly BSD

It has just occurred to me we might want to make this change for GCC5:

diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4
index 1727140..0b8c0f0 100644
--- a/libstdc++-v3/acinclude.m4
+++ b/libstdc++-v3/acinclude.m4
 <at>  <at>  -1219,11 +1219,11  <at>  <at>  AC_DEFUN([GLIBCXX_ENABLE_LIBSTDCXX_TIME], [
-      freebsd*|netbsd*)
+      freebsd*|netbsd*|dragonfly*)

We could make this change post-GCC5 but as the dragonfly target is new
for GCC5 it would be a shame to release it with a sub-optimal
resolution for clocks and thread sleeping.

John, assuming I'm right that dragonfly supports all these features,
could you test this change?  (You'll need the same change on line
19555 of the libstdc++-v3/configure script.)

Jonathan Wakely | 10 Mar 19:05 2015

[wwwdocs] Tweak /gcc-5/porting_to.html wording about converting nullptr to bool

Since nullptr always converts to false it doesn't make much sense to
recommend using 'true' instead.

Committed to CVS.

Attachment (patch.txt): text/x-patch, 628 bytes
Jonathan Wakely | 4 Mar 18:20 2015

[patch] libstdc++/64797 fix handling of incomplete multibyte characters

To fix the non-portable 22_locale/conversions/string/ test I
changed it to use char16_t and char32_t where I can reliably create an
invalid sequence that causes a conversion error. That revealed some
more problems in the Unicode conversion utilities, fixed by this patch
and verified by the new tests.

Most of the changes in are just defining convenience
constants and inline functions, but there are some minor bugs fixed in
UTF-16 error handling too.

Tested x86_64-linux, committed to trunk.
Attachment (patch.txt): text/x-patch, 17 KiB