Commit 6f7ee55a authored by Jeremy Apthorp's avatar Jeremy Apthorp Committed by Commit Bot

qualify base::data and base::size in span.h

This fixes an ambiguous reference when building against MSSTL:

In file included from ../../content/browser/webauth/virtual_authenticator.cc:5:
In file included from ../..\content/browser/webauth/virtual_authenticator.h:16:
In file included from ../..\device/fido/virtual_fido_device.h:17:
../..\base/containers/span.h(501,21): error: call to 'data' is ambiguous
  return span<T, N>(data(container), size(container));
                    ^~~~
../../content/browser/webauth/virtual_authenticator.cc(148,29): note: in instantiation of function template specialization 'base::make_span<32, std::vector<unsigned char, std::allocator<unsigned char> >, unsigned char, void>' requested here

                      base::make_span<device::kRpIdHashLength>(
                            ^
_NODISCARD constexpr auto data(_Container& _Cont) -> decltype(_Cont.data()) { // get data() for container
                          ^
../..\base/stl_util.h(116,16): note: candidate function [with Container = std::vector<unsigned char, std::allocator<unsigned char> >]
constexpr auto data(Container& c) -> decltype(c.data()) {
               ^
_NODISCARD constexpr auto data(const _Container& _Cont)
                          ^
../..\base/stl_util.h(133,16): note: candidate function [with Container = std::vector<unsigned char, std::allocator<unsigned char> >]
constexpr auto data(const Container& c) -> decltype(c.data()) {
               ^
1 error generated.

C: \projects\src\out\Default\..\..\..\..\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.23.28105\include\xutility(1168,27): note: candidate function [with _Container = std::vector<unsigned char, std::allocator<unsigned char> >]
C: \projects\src\out\Default\..\..\..\..\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.23.28105\include\xutility(1173,27): note: candidate function [with _Container = std::vector<unsigned char, std::allocator<unsigned char> >]
Change-Id: Icf64aecbc5501a9aa3a9938befef0a703745d5ac
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1894264
Commit-Queue: Jeremy Apthorp <jeremya@chromium.org>
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Auto-Submit: Jeremy Apthorp <jeremya@chromium.org>
Reviewed-by: default avatarDaniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#711506}
parent c4b246b8
......@@ -498,7 +498,7 @@ template <size_t N,
decltype(base::data(std::declval<Container&>()))>,
typename = internal::EnableIfSpanCompatibleContainer<Container&, T>>
constexpr span<T, N> make_span(Container& container) noexcept {
return span<T, N>(data(container), size(container));
return span<T, N>(base::data(container), base::size(container));
}
template <
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment