googleapis / googleapis/google-cloud-cpp
Update HttpHeaderName conversion operators to satisfy MSVC
- Lenguaje dominante
- C++
- Estrellas
- 659
- Forks
- 462
- Merge medio
- 1 d 2 h
- PR fusionados (30 d)
- 89
Descripción
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
```
Guía de contribución
Línea de trabajo
Comienza con google/cloud/internal/http_header_test.cc, especialmente con la aserción que falla en la línea 35, e inspecciona los operadores de conversión de HttpHeaderName que esta ejercita. Reproduce el fallo con MSVC y compara el comportamiento de las sobrecargas con el de otros compiladores; se considera terminado cuando el test se compila y pasa en MSVC sin reducir la cobertura prevista.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- cpp
- Área
- networking
- Tipo de issue
- Error
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Estado de actividad
- Tranquilo
- Claridad
- Necesita aclaración
- Aptitud para principiantes
- 55/100