diff -up chromium-65.0.3325.146/base/optional.h.784732 chromium-65.0.3325.146/base/optional.h --- chromium-65.0.3325.146/base/optional.h.784732 2018-03-07 13:40:00.103579631 -0500 +++ chromium-65.0.3325.146/base/optional.h 2018-03-07 13:41:08.950323996 -0500 @@ -9,6 +9,7 @@ #include #include "base/logging.h" +#include "base/template_util.h" namespace base { @@ -106,7 +107,7 @@ struct OptionalStorageBase::value, + bool = is_trivially_copy_constructible::value, bool = std::is_trivially_move_constructible::value> struct OptionalStorage : OptionalStorageBase { // This is no trivially {copy,move} constructible case. Other cases are diff -up chromium-65.0.3325.146/base/template_util.h.784732 chromium-65.0.3325.146/base/template_util.h --- chromium-65.0.3325.146/base/template_util.h.784732 2018-03-07 13:41:19.479131969 -0500 +++ chromium-65.0.3325.146/base/template_util.h 2018-03-07 13:42:41.308639551 -0500 @@ -10,6 +10,7 @@ #include #include #include +#include #include "build/build_config.h" @@ -127,6 +128,23 @@ template using is_trivially_copyable = std::is_trivially_copyable; #endif +#if defined(__GNUC__) && !defined(__clang__) && __GNUC__ <= 7 +// Workaround for g++7 and earlier family. +// Due to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80654, without this +// Optional> where T is non-copyable causes a compile error. +// As we know it is not trivially copy constructible, explicitly declare so. +template +struct is_trivially_copy_constructible + : std::is_trivially_copy_constructible {}; + +template +struct is_trivially_copy_constructible> : std::false_type {}; +#else +// Otherwise use std::is_trivially_copy_constructible as is. +template +using is_trivially_copy_constructible = std::is_trivially_copy_constructible; +#endif + } // namespace base #undef CR_USE_FALLBACKS_FOR_GCC_WITH_LIBCXX