googleapis / googleapis/google-cloud-cpp

Update HttpHeaderName conversion operators to satisfy MSVC

Aperta
#16,171 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
type: cleanup
Lingua principale
C++
Stelle
659
Fork
462
Merge medio
1g 2h
PR unite (30g)
89

Descrizione

MSVC produces errors other compilers do not. Is MSVC more correct? Unsure. Skip these tests in MSVC until we can figure out the more correct set of overloads for the conversion operators.

```
FAILED: [code=2] google/cloud/CMakeFiles/common_internal_http_header_test.dir/internal/http_header_test.cc.obj
sccache C:\PROGRA~1\MICROS~2\2022\ENTERP~1\VC\Tools\MSVC\1444~1.352\bin\Hostx64\x64\cl.exe /nologo /TP -DABSL_CONSUME_DLL -DGOOGLE_CLOUD_CPP_HAVE_GETRUSAGE=0 -DGOOGLE_CLOUD_CPP_HAVE_RUSAGE_THREAD=0 -DGTEST_LINKED_AS_SHARED_LIBRARY=1 -DNOMINMAX -DOPENTELEMETRY_ABI_VERSION_NO=1 -DOPENTELEMETRY_STL_VERSION=2017 -ID:\a\google-cloud-cpp\google-cloud-cpp -external:IC:\b\vcpkg_installed\x64-windows\include -external:IC:\b -external:W0 /DWIN32 /D_WINDOWS /EHsc /O2 /Ob2 /DNDEBUG -std:c++17 -MD /bigobj /experimental:external /external:W0 /external:anglebrackets /W3 /wd4996 /WX /showIncludes /Fogoogle\cloud\CMakeFiles\common_internal_http_header_test.dir\internal\http_header_test.cc.obj /Fdgoogle\cloud\CMakeFiles\common_internal_http_header_test.dir\ /FS -c D:\a\google-cloud-cpp\google-cloud-cpp\google\cloud\internal\http_header_test.cc
D:\a\google-cloud-cpp\google-cloud-cpp\google\cloud\internal\http_header_test.cc(35): error C2440: '': cannot convert from 'google::cloud::rest_internal::v3_6::HttpHeaderName' to 'std::string'
D:\a\google-cloud-cpp\google-cloud-cpp\google\cloud\internal\http_header_test.cc(35): note: 'std::basic_string,std::allocator>::basic_string': ambiguous call to overloaded function
C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.44.35207\include\xstring(716): note: could be 'std::basic_string,std::allocator>::basic_string(const std::basic_string,std::allocator> &)'
C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.44.35207\include\xstring(1027): note: or 'std::basic_string,std::allocator>::basic_string(std::basic_string,std::allocator> &&) noexcept'
C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.44.35207\include\xstring(768): note: or 'std::basic_string,std::allocator>::basic_string(const _Elem *const )'
with
[
_Elem=char
]
D:\a\google-cloud-cpp\google-cloud-cpp\google\cloud\internal\http_header_test.cc(35): note: while trying to match the argument list '(google::cloud::rest_internal::v3_6::HttpHeaderName)'
D:\a\google-cloud-cpp\google-cloud-cpp\google\cloud\internal\http_header_test.cc(35): error C3889: call to object of class type 'testing::internal::PredicateFormatterFromMatcher>': no matching call operator found
C:\b\vcpkg_installed\x64-windows\include\gmock/gmock-matchers.h(1644): note: could be 'testing::AssertionResult testing::internal::PredicateFormatterFromMatcher>::operator ()(const char *,const T &) const'
D:\a\google-cloud-cpp\google-cloud-cpp\google\cloud\internal\http_header_test.cc(35): note: 'testing::AssertionResult testing::internal::PredicateFormatterFromMatcher>::operator ()(const char *,const T &) const': expects 2 arguments - 1 provided
D:\a\google-cloud-cpp\google-cloud-cpp\google\cloud\internal\http_header_test.cc(35): error C2737: 'gtest_ar': const object must be initialized

```

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.