Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(399)

Issue 2453733002: Fix base::Optional constexpr ctor on gcc 4.8. (Closed)

Created:
4 years, 1 month ago by alshabalin
Modified:
4 years, 1 month ago
CC:
chromium-reviews
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Fix base::Optional constexpr ctor on gcc 4.8. g++ 4.8 failed to compile base::Optional<std::unique_ptr<int>>(). A simpler example is: class C { public: constexpr C() {} ~C() {} private: union { char empty_ = '\0'; std::unique_ptr<int> value_; }; }; g++ 4.8 fails to compile this. But adding empty_('\0') to member initializer list makes it happy. This patch does the same for both OptionalStorage default constructors. BUG= Committed: https://crrev.com/a637f25fb515f8e860bc941cc1cb24b7862f3c5b Cr-Commit-Position: refs/heads/master@{#427850}

Patch Set 1 #

Total comments: 4

Patch Set 2 : Address review comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+12 lines, -8 lines) Patch
M base/optional.h View 1 3 chunks +12 lines, -8 lines 0 comments Download

Messages

Total messages: 12 (4 generated)
alshabalin
This is a follow up CL to https://codereview.chromium.org/2434253003/ fixing compilation with g++ 4.8.
4 years, 1 month ago (2016-10-26 11:46:34 UTC) #2
Mostyn Bramley-Moore
Works for me.
4 years, 1 month ago (2016-10-26 12:23:46 UTC) #3
danakj
https://codereview.chromium.org/2453733002/diff/1/base/optional.h File base/optional.h (right): https://codereview.chromium.org/2453733002/diff/1/base/optional.h#newcode64 base/optional.h:64: char empty_ = '\0'; can you drop the \0 ...
4 years, 1 month ago (2016-10-26 18:56:49 UTC) #4
danakj
LGTM
4 years, 1 month ago (2016-10-26 18:56:54 UTC) #5
alshabalin
Also tweaked comments a bit. https://codereview.chromium.org/2453733002/diff/1/base/optional.h File base/optional.h (right): https://codereview.chromium.org/2453733002/diff/1/base/optional.h#newcode64 base/optional.h:64: char empty_ = '\0'; ...
4 years, 1 month ago (2016-10-26 20:42:38 UTC) #6
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/2453733002/20001
4 years, 1 month ago (2016-10-26 20:43:40 UTC) #9
commit-bot: I haz the power
Committed patchset #2 (id:20001)
4 years, 1 month ago (2016-10-26 22:29:55 UTC) #10
commit-bot: I haz the power
4 years, 1 month ago (2016-10-26 22:33:36 UTC) #12
Message was sent while issue was closed.
Patchset 2 (id:??) landed as
https://crrev.com/a637f25fb515f8e860bc941cc1cb24b7862f3c5b
Cr-Commit-Position: refs/heads/master@{#427850}

Powered by Google App Engine
This is Rietveld 408576698