diff --git base/ranges/ranges.h base/ranges/ranges.h index 27eac4f3a4c39..2cb63bec79e63 100644 --- base/ranges/ranges.h +++ base/ranges/ranges.h @@ -30,12 +30,14 @@ constexpr T* begin(std::array& array, priority_tag<2> tag) { return const_cast(begin(const_cast&>(array), tag)); } +#if !defined(CEF_EXCLUDE_PROBLEMATIC_CONST_ARRAY_OVERLOADS) // Overload for const std::array. Required since std::array::begin is not // constexpr prior to C++17. template constexpr const T* begin(const std::array& array, priority_tag<2>) { return N != 0 ? &array[0] : nullptr; } +#endif // Generic container overload. template @@ -65,12 +67,14 @@ constexpr T* end(std::array& array, priority_tag<2> tag) { return const_cast(end(const_cast&>(array), tag)); } +#if !defined(CEF_EXCLUDE_PROBLEMATIC_CONST_ARRAY_OVERLOADS) // Overload for const std::array. Required since std::array::end is not // constexpr prior to C++17. template constexpr const T* end(const std::array& array, priority_tag<2>) { return N != 0 ? (&array[0]) + N : nullptr; } +#endif // Generic container overload. template diff --git base/win/registry.cc base/win/registry.cc index 7b9dcb90e627e..275b60e6c2a28 100644 --- base/win/registry.cc +++ base/win/registry.cc @@ -14,6 +14,14 @@ #include #include +#include "cef/libcef/features/features.h" + +#if BUILDFLAG(IS_CEF_SANDBOX_BUILD) +// Avoid overloads for const std::array in base/ranges/ranges.h that don't +// compile with MSVC. See issue #3519. +#define CEF_EXCLUDE_PROBLEMATIC_CONST_ARRAY_OVERLOADS 1 +#endif + #include "base/check_op.h" #include "base/functional/callback.h" #include "base/notreached.h"