Jonathan Wakely | 30 Jul 14:40 2015
Picon

[v3 patch] Fix FAIL in experimental/filesystem/operations/current_path.cc

This test is failing on Darwin, it turns out to be because TMPDIR is
set to a symlink, so after changing to that directory current_path()
returns a different path. We should canonicalize the paths before
comparing them.

Tested x86_64-linux, committed to trunk.

Attachment (patch.txt): text/x-patch, 1117 bytes
Jonathan Wakely | 30 Jul 12:00 2015
Picon

[v3 patch] Fix self-assignment in std::experimental::any

When I fixed any's copying of non-trivial types I broke the
self-assignment case. This adds an explicit check for it.

Thanks to Axel Menzel for noticing the bug.

Tested ppc64le-linux, committed to trunk.

Attachment (patch.txt): text/x-patch, 2669 bytes
Jonathan Wakely | 29 Jul 16:56 2015
Picon

[patch] libstdc++/66829 use -std=gnu++98 to compile testsuite_shared.cc

This file contains some C++98 instantiations that are then compared to
similar instantiations in C++11 tests, so it needs to be compiled with
an explicit -std option now that g++ defaults to gnu++14.

Tested i686-linux, x86_64-linux and ppc64le-linux.

Committed to trunk.

Attachment (patch.txt): text/x-patch, 948 bytes
Jonathan Wakely | 28 Jul 13:57 2015
Picon

Re: [GSoC] Patches for shared_ptr array and polymorphic_allocator

On 28/07/15 02:55 +0000, Fan You wrote:
>Thanks for the review, they helped a lot.
>
>
>When I writing test for polymorphic_allocator, I found [2.1.1] has not been
>implemented which made use-allocator construction test for memory_resource*
>impossible. So, I implemented it and the patch is attached, am I allowed to
>do modification on place outside std::experimental?

It's definitely not OK to #include <experimental/utility> in the
non-experimental standard headers.

I think we can adapt the existing one to work for PMRs in a safe and
extensible way.

If you declare std::__erased_type as an empty struct and extend
uses_allocator to check for it, then we don't pollute the namespace
with the names "experimental" or "erased_type".

Then in <experimental/utility> you can declare
std::experimental::erased_type as a typedef for std::__erased_type.

+  template<typename _Alloc, typename _Tp>
+    struct __erased_type_helper
+    { using type = typename is_convertible<_Alloc, _Tp>::type; };
+
+  template<typename _Alloc>
+    struct __erased_type_helper<_Alloc, std::experimental::erased_type>
+    { using type = true_type; };

(Continue reading)

François Dumont | 27 Jul 21:16 2015
Picon

Debug assertion and constexpr

Hello

    There are at the moment several failures in the libstdc++ testsuite
when run in debug mode (_GLIBCXX_DEBUG). This is so because debug
assertions are not const expressions. Several debug assertions have been
removed because of this issue.

    So is there a way to define a function as to be ignored in the
context of a const expression ? If not could we add one ?

François

Tim Shen | 25 Jul 09:11 2015
Picon

[Patch] Small refactor on <regex> _State<>

It's not a very necessary refactoring, but simply can't resist. :)

I'm not sure of the ::memcpy calls. It looks not very idiomatic, but
std::copy on char* looks even more weird? :/

Bootstrapped and tested.

Thanks!

-- 
Regards,
Tim Shen
commit c546499cac2bdb13b31dff373fc814a1330bbdeb
Author: Tim Shen <timshen <at> google.com>
Date:   Fri Jul 24 23:12:09 2015 -0700

    	* include/bits/regex_automaton.h(_State_base, _State<>):
    	Remove _TraitsT dependency from _State<>; Make matcher member
    	into the union to reduce struct size.
    	* include/bits/regex_automaton.tcc(_State_base<>::_M_print,
    	_State_base<>::_M_dot, _StateSeq<>::_M_clone):
    	Adjust to fit the interface. Factor out common parts in
    	_M_clone as _State<>::_M_has_alt.
    	* include/bits/regex_executor.h: Pass by const reference for
    	_M_lookahead.
    	* include/bits/regex_executor.tcc: Adjust to fit the interface.

diff --git a/libstdc++-v3/include/bits/regex_automaton.h b/libstdc++-v3/include/bits/regex_automaton.h
(Continue reading)

Patrick Palka | 23 Jul 04:30 2015

__atomic_futex_unsigned::_M_load_when_not_equal has a 'return' statement with no value, in function returning unsigned int

Specifically, line 149 of atomix_futex.h has a bare "return;"
statement, but the function is marked as returning non-void.  This was
caught while working on PR c++/18969.  Vanilla G++ does not catch this
error because return statements inside templates are currently only
analyzed during instantiation time.

Tim Shen | 22 Jul 07:16 2015
Picon

Generic questions on inline functions and linking

If a user compiled two object files, one with exception (or rtti,
doesn't matter) turned on, but another without, and links them
together, such a function in libstdc++ may be problematic:

inline void __foo()
{
  __try
    {
      // ...
    }
  __catch(...)
    {
      // ...
    }
}

since it's an odr violation.

Should the user be responsible for this, or we should avoid writing
such a thing? I guess it applies to template functions as well?

I raise this because recently I'm refactoring regex library, and found
that marking the giant regex library inlined (including template
function) improves >10% time efficiency and reduces binary size. It's
really good to keep them inlined since they are anyway in the header,
and there is no real reason should we let use to keep multiple copies
in an executable.

Thanks!

(Continue reading)

Ville Voutilainen | 20 Jul 23:49 2015
Picon

[v3 PATCH] Implement N4279, Improved insertion interface for unique-key maps.

Tested on Linux-PPC64.

2015-07-21  Ville Voutilainen  <ville.voutilainen <at> gmail.com>
    Implement N4279, Improved insertion interface for unique-key maps.
    * include/bits/stl_map.h (try_emplace, insert_or_assign): New.
    * include/bits/stl_tree.h (_M_get_insert_unique_pos,
    _M_get_insert_equal_pos, _M_get_insert_hint_unique_pos,
    _M_get_insert_hint_equal_pos): Make public.
    * include/bits/unordered_map.h (try_emplace, insert_or_assign): New.
    * testsuite/23_containers/map/modifiers/insert_or_assign/1.cc:
    Likewise.
    * testsuite/23_containers/map/modifiers/try_emplace/1.cc: Likewise.
    * testsuite/23_containers/unordered_map/modifiers/insert_or_assign.cc:
    Likewise.
    * testsuite/23_containers/unordered_map/modifiers/try_emplace.cc:
    Likewise.
Attachment (improved-interface.diff.gz): application/x-gzip, 5966 bytes
Tim Shen | 19 Jul 08:29 2015
Picon

Re: [GSoC] Patches for shared_ptr array and polymorphic_allocator

On Sat, Jul 18, 2015 at 3:01 PM, Fan You <youfan.noey <at> gmail.com> wrote:
> However [8.8.6] said, If r is non-null, sets the value of the default memory
> resource pointer to r, otherwise sets the default memory resource pointer to
> new_delete_resource().

Ah right, so the only place we should care about is set_default_resource:
void
set_default_resource(memory_resource __r)
{
  std::atomic<memory_resource> __new_ptr = __r ? __r : new_delete_resource();
  return __new_ptr.exchange(memory_resource::_S_default_resource);
}

--

-- 
Regards,
Tim Shen

Bruce Perens | 16 Jul 21:11 2015

checking for shl_load... configure: error: Link tests are not allowed after GCC_NO_EXECUTABLES.

Hi,

I am building GCC for ARM Cortex M3 without floating point, target
arm-linux-eabi. The compiler builds. When I get to libstdc++,
configure emits this:

checking for shl_load... configure: error: Link tests are not allowed
after GCC_NO_EXECUTABLES.

I'm inexperienced in building this library and am not an autotools
pro, but it seems that anyone who was cross compiling would hit this.
What am I missing?

Here are the configure flags from config.log:

  $ /home/bruce/SF2/build/external/src/gcc/libstdc++-v3/configure
--srcdir=/home/bruce/SF2/build/external/src/gcc/libstdc++-v3
--cache-file=./config.cache --with-cross-host=x86_64-unknown-linux-gnu
--prefix=/home/bruce/SF2/build/toolchain
--with-headers=/home/bruce/SF2/build/toolchain/include
--with-build-time-tools=/home/bruce/SF2/build/toolchain/arm-linux-eabi/bin
--with-mode=thumb --with-endian=little --with-float=soft
--with-float-abi=soft --disable-multilib
--enable-languages=c,c++,fortran,java,lto,objc
--program-transform-name=s&^&arm-linux-eabi-&
--disable-option-checking --with-target-subdir=arm-linux-eabi
--build=x86_64-unknown-linux-gnu --host=arm-linux-eabi
--target=arm-linux-eabi

These arguments are being constructed by the gcc ./configure, which is
(Continue reading)


Gmane