[PATCH] Fix regex_replace

2018-01-12 Thread Tim Shen via gcc-patches
This fixes PR 83601. Tested on x86_64-linux-gnu. -- Regards, Tim Shen commit 01a85ea3ae77acc7ad03430a6982db1b2b8c8bc3 Author: Tim Shen Date: Fri Jan 12 22:22:45 2018 -0800 PR libstdc++/83601 * include/bits/regex.tcc (regex_replace): Fix escaping

Re: [libstdc++/71500] make back reference work with icase

2017-09-18 Thread Tim Shen via gcc-patches
On Mon, Sep 18, 2017 at 4:01 PM, Jonathan Wakely wrote: > On 18/09/17 10:58 -0700, Tim Shen via libstdc++ wrote: >> >> On Mon, Sep 18, 2017 at 10:26 AM, Jonathan Wakely >> wrote: We need to rewrite this to check the lengths are equal first, and

Re: [libstdc++/71500] make back reference work with icase

2017-09-18 Thread Tim Shen via gcc-patches
On Mon, Sep 18, 2017 at 10:26 AM, Jonathan Wakely wrote: >> We need to rewrite this to check the lengths are equal first, and then >> call the 3-argument version of std::equal. >> >> Alternatively, we could move the implementation of the C++14 >> std::equal overloads to

[libstdc++/71500] make back reference work with icase

2017-09-04 Thread Tim Shen via gcc-patches
This fixes the follow-up comments in 71500. Back-reference matching is different from other matching, as the content the back-reference refers to is at "run-time", aka during regex_match(), not regex() compilation. For compilation we do have an abstraction layer to catch all comparison

Re: [Patch] Forward triviality in variant

2017-06-18 Thread Tim Shen via gcc-patches
Besides the changes on the comments, I also changed the definition of _S_trivial_copy_assign and _S_trivial_move_assign to match what union has. See [class.copy.assign]p9. On Thu, Jun 1, 2017 at 8:13 AM, Jonathan Wakely wrote: > On 30/05/17 02:16 -0700, Tim Shen via libstdc++ wrote: >> >> diff

Re: [PATCH] PR libstdc++/80939 Remove unmeetable constexpr specifiers

2017-06-02 Thread Tim Shen via gcc-patches
On Fri, Jun 2, 2017 at 6:07 AM, Jonathan Wakely wrote: > As the PR points out, we aren't qualifying calls to __ref_cast, and > have 'constexpr' on function templates that can never be usable in > constant expressions. Apology for the constexpr trolling, but that was not intentional. :) I'm

Re: [Patch] Forward triviality in variant

2017-05-30 Thread Tim Shen via gcc-patches
On Mon, May 29, 2017 at 11:29 PM, Tim Shen wrote: > This patch implements > , but with more Actually, it didn't. The copy assign and move assign conditions are wrong in the patch. Fixed those. -- Regards, Tim Shen commit

[Patch] Forward triviality in variant

2017-05-30 Thread Tim Shen via gcc-patches
This patch implements , but with more changes than the proposal's. It 1) Creates __detail::__variant::_Traits as a centralized place to hold common (but not all yet) compile-time conditions. 2) Changes the noexcept conditions for the (copy|move)

Re: [Patch] SFINAE on is_same first in variant's _Tp&& constructor

2017-05-28 Thread Tim Shen via gcc-patches
On Tue, May 23, 2017 at 3:24 AM, Jonathan Wakely wrote: > On 22/05/17 16:14 -0400, Tim Song wrote: > Ah I see. > >> The original patch does that (assuming core issue 1227's resolution), >> but the __and_ version doesn't; __and_ only short circuits the >> immediate parameter, not things used in

Re: [Patch] SFINAE on is_same first in variant's _Tp&& constructor

2017-05-22 Thread Tim Shen via gcc-patches
On Mon, May 22, 2017 at 11:05 AM, Tim Shen wrote: > On Mon, May 22, 2017 at 6:21 AM, Jonathan Wakely wrote: > I suggest to cc a front-end person (Jason?) to take a look, as I > suggested in the bug, and the example: https://godbolt.org/g/AxUv16. See more

Re: [Patch] SFINAE on is_same first in variant's _Tp&& constructor

2017-05-22 Thread Tim Shen via gcc-patches
On Mon, May 22, 2017 at 6:21 AM, Jonathan Wakely wrote: > On 19/05/17 22:40 -0700, Tim Shen via libstdc++ wrote: >> >> diff --git a/libstdc++-v3/include/std/variant >> b/libstdc++-v3/include/std/variant >> index 0e04a820d69..b9824a5182c 100644 >> ---

[Patch] SFINAE on is_same first in variant's _Tp&& constructor

2017-05-19 Thread Tim Shen via gcc-patches
This fixes PR libstdc++/80737. I actually can't come up with a minimal test case, because I suspect that there is a front-end bug in GCC. See discussions in the bug. Tested on x86_64-linux-gnu. Thanks! -- Regards, Tim Shen commit 6f362991f025069328c4901d95b657d498aad250 Author: Tim Shen

Re: [PATCH] Implement P0393R3

2017-02-15 Thread Tim Shen via gcc-patches
On Mon, Jan 9, 2017 at 2:52 AM, Jonathan Wakely wrote: > On 08/01/17 22:49 -0800, Tim Shen wrote: >> >> On Tue, Jan 3, 2017 at 6:17 AM, Jonathan Wakely >> wrote: >>> >>> On 01/01/17 04:17 -0800, Tim Shen via libstdc++ wrote: +#define

Re: [PATCH] Fix return type detection in visit()

2017-02-14 Thread Tim Shen via gcc-patches
On Tue, Feb 14, 2017 at 2:49 PM, Jonathan Wakely wrote: > On 14/02/17 13:59 -0800, Tim Shen via libstdc++ wrote: >> >> This is an obvious missing std::forward. :) > > > I was about to look into it, I assumed it would be something simple! > >> diff --git

[PATCH] Fix return type detection in visit()

2017-02-14 Thread Tim Shen via gcc-patches
This is an obvious missing std::forward. :) Testing on x86_64-linux-gnu, but I expect it to pass. -- Regards, Tim Shen commit 08235141a7e06db2b604b5869c9d8e4aaf8fa29b Author: Tim Shen Date: Tue Feb 14 13:55:18 2017 -0800 2017-02-14 Tim Shen

[PATCH] Reduce _GLIBCXX_REGEX_STATE_LIMIT

2017-02-10 Thread Tim Shen via gcc-patches
Thanks Kostya for the fuzzing work! Reduce it to a reasonably small number (but not too small), so that libFuzzer doesn't find as many crashers (none in a short period of time, actually) with a 8MB stack on a 64-bit machine. Thanks! -- Regards, Tim Shen commit

Re: [PATCH] Fix the UB in regex caused by long decimal string

2017-02-10 Thread Tim Shen via gcc-patches
Add gcc-patches. On Fri, Feb 10, 2017 at 5:48 PM, Tim Shen wrote: > Oops I attached a diff without the ChangeLog. Attach again. > > -- > Regards, > Tim Shen -- Regards, Tim Shen

Re: [v3 PATCH] Reduce the size of variant, it doesn't need an index of type size_t internally.

2017-01-10 Thread Tim Shen via gcc-patches
On Tue, Jan 10, 2017 at 2:19 PM, Ville Voutilainen wrote: > Cleanups based on review; there's no longer any public typedefs added > to variant, > and the test is greatly simpler with much less trickery. Looks good to me. Thanks! -- Regards, Tim Shen

Re: [PATCH] Implement P0393R3

2017-01-08 Thread Tim Shen via gcc-patches
On Tue, Jan 3, 2017 at 6:17 AM, Jonathan Wakely wrote: > On 01/01/17 04:17 -0800, Tim Shen via libstdc++ wrote: >> >> +#define _VARIANT_RELATION_FUNCTION_TEMPLATE(__op, __name) \ >> + template \ >> +constexpr bool operator __op(const variant<_Types...>& __lhs, \ >> +

Re: [PATCH] s/__unused/__dimensions/ in

2017-01-04 Thread Tim Shen via gcc-patches
On Wed, Jan 4, 2017 at 7:16 PM, Tim Shen wrote: > Since it's an obvious textual fix, I'm going to check it in directly. Checked in with 80-columns limit respected. I have confusing tabstop settings... :/ -- Regards, Tim Shen

[PATCH] s/__unused/__dimensions/ in

2017-01-04 Thread Tim Shen via gcc-patches
Since it's an obvious textual fix, I'm going to check it in directly. -- Regards, Tim Shen commit b005916b043f52feed32b646f86ced80f3e5392b Author: Tim Shen Date: Wed Jan 4 19:07:07 2017 -0800 2017-01-05 Tim Shen PR