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

Unified Diff: base/optional.h

Issue 2453733002: Fix base::Optional constexpr ctor on gcc 4.8. (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/optional.h
diff --git a/base/optional.h b/base/optional.h
index a32e06808d82cd7b75b66009880d891e4d62fceb..528610aa8e7a39c3f8808f9615cc1c6746d2f461 100644
--- a/base/optional.h
+++ b/base/optional.h
@@ -34,7 +34,8 @@ namespace internal {
template <typename T, bool = base::is_trivially_destructible<T>::value>
struct OptionalStorage {
- constexpr OptionalStorage() {}
+ // Initializing |empty_| here to avoid errors in g++ 4.8.
+ constexpr OptionalStorage() : empty_('\0') {}
constexpr explicit OptionalStorage(const T& value)
: is_null_(false), value_(value) {}
@@ -67,7 +68,8 @@ struct OptionalStorage {
template <typename T>
struct OptionalStorage<T, true> {
- constexpr OptionalStorage() {}
+ // Initializing |empty_| here to avoid errors in g++ 4.8.
+ constexpr OptionalStorage() : empty_('\0') {}
constexpr explicit OptionalStorage(const T& value)
: is_null_(false), value_(value) {}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698