Chromium Code Reviews
Help | Chromium Project | Gerrit Changes | Sign in
(5)

Issue 2241603002: Add explicit TimeDelta constexpr copy constructor. (Closed)

Created:
3 years, 2 months ago by liberato (no reviews please)
Modified:
3 years, 2 months ago
CC:
chromium-reviews
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Add explicit TimeDelta constexpr copy constructor. MSVC fails to initialize constexpr TimeDelta instances in some situations. It turns out (thanks brucedawson@) that including an explicit constexpr copy constructor works around this. BUG=635974 Committed: https://crrev.com/f4831ddd84ec8f068fb934a6de94560e202c01eb Cr-Commit-Position: refs/heads/master@{#411805}

Patch Set 1 #

Total comments: 6

Patch Set 2 : cl feedback -- windows only #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+854 lines, -839 lines) Patch
M base/time/time.h View 1 1 chunk +844 lines, -839 lines 0 comments Download
M base/time/time_win_unittest.cc View 1 2 chunks +10 lines, -0 lines 1 comment Download

Messages

Total messages: 21 (8 generated)
liberato (no reviews please)
hi all miu: PTAL for owner review. thanks -fl
3 years, 2 months ago (2016-08-11 21:34:53 UTC) #3
miu
https://codereview.chromium.org/2241603002/diff/1/base/time/time.h File base/time/time.h (right): https://codereview.chromium.org/2241603002/diff/1/base/time/time.h#newcode246 base/time/time.h:246: constexpr TimeDelta(const TimeDelta& other) : delta_(other.delta_) {} Since the ...
3 years, 2 months ago (2016-08-11 21:48:56 UTC) #4
liberato (no reviews please)
i'm hoping that the flurry of CRLF translations during upload ended up in the right ...
3 years, 2 months ago (2016-08-11 22:10:35 UTC) #5
miu
lgtm
3 years, 2 months ago (2016-08-11 22:37:47 UTC) #6
brucedawson
On 2016/08/11 22:37:47, miu wrote: > lgtm Have you confirmed that the test fails without ...
3 years, 2 months ago (2016-08-11 23:12:32 UTC) #7
liberato (no reviews please)
On 2016/08/11 23:12:32, brucedawson wrote: > On 2016/08/11 22:37:47, miu wrote: > > lgtm > ...
3 years, 2 months ago (2016-08-12 16:02:20 UTC) #8
brucedawson
lgtm
3 years, 2 months ago (2016-08-12 17:11:36 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2241603002/20001
3 years, 2 months ago (2016-08-12 17:35:02 UTC) #11
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_asan_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_asan_rel_ng/builds/209023)
3 years, 2 months ago (2016-08-12 19:37:12 UTC) #13
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2241603002/20001
3 years, 2 months ago (2016-08-12 20:40:58 UTC) #15
commit-bot: I haz the power
Committed patchset #2 (id:20001)
3 years, 2 months ago (2016-08-12 22:38:34 UTC) #17
commit-bot: I haz the power
Patchset 2 (id:??) landed as https://crrev.com/f4831ddd84ec8f068fb934a6de94560e202c01eb Cr-Commit-Position: refs/heads/master@{#411805}
3 years, 2 months ago (2016-08-12 22:45:12 UTC) #19
Jeffrey Yasskin
3 years, 2 months ago (2016-08-12 23:07:44 UTC) #21
Message was sent while issue was closed.
Thanks for doing this.

https://codereview.chromium.org/2241603002/diff/20001/base/time/time_win_unit...
File base/time/time_win_unittest.cc (right):

https://codereview.chromium.org/2241603002/diff/20001/base/time/time_win_unit...
base/time/time_win_unittest.cc:300: EXPECT_EQ(kExpectedDeltaInMilliseconds,
kConstexprTimeDelta.InMilliseconds());
You're testing a bug in constexpr variables, so you shouldn't really use
constexpr variables on both sides of the EXPECT_EQ: the bug could cancel itself
out.

I think that's unlikely in this case because of the nature of the bug, but it'd
be a better test with a literal '10' there.

Powered by Google App Engine
This is Rietveld 408576698