Anders Wind created ARROW-14800:
-----------------------------------
Summary: Compiler error on LocalFileSystem::OpenOutputStream
"'arrow::internal::launder': ambiguous call to overloaded function"
Key: ARROW-14800
URL: https://issues.apache.org/jira/browse/ARROW-14800
Project: Apache Arrow
Issue Type: Bug
Components: C++
Affects Versions: 6.0.1
Environment: Windows 10, Visual Studio 2019 16.11.6
Reporter: Anders Wind
Hi, I'm trying to upgrade to arrow-cpp 6.0 and I have some code which compiles
with 5.0.0:
{code:java}
inline void write_table(const std::shared_ptr<arrow::Table>& table, const
std::string& file)
{
auto arrow_fs_ = arrow::fs::LocalFileSystem();
std::string corrected_path = value_or_throw(arrow_fs_.NormalizePath(file));
auto stream_opt = arrow_fs_.OpenOutputStream(corrected_path);
auto status = arrow::ipc::feather::WriteTable(*table,
value_or_throw(stream_opt).get());
ALCC_ARROW_STATUS_CHECK(status);
}{code}
The following line is the root of the compile stack trace
{code:java}
auto stream_opt = arrow_fs_.OpenOutputStream(corrected_path);{code}
It gives me the following error:
{code:java}
C:\Users\anders.wind\Miniconda3\envs\quant_env_r20211123_1359_841f2c7e\Library\include\arrow/util/aligned_storage.h(36,1):
error C2668: 'arrow::internal::launder': ambiguous call to overloaded function
[C:\Users\anders.wind\Documents\0.Projects\AlipesQuant\alcc\build\market_data\marke
t_data.vcxproj]
C:\Users\anders.wind\Miniconda3\envs\quant_env_r20211123_1359_841f2c7e\Library\include\arrow/util/launder.h(29,14):
message : could be 'T *arrow::internal::launder<T>(T *) noexcept'
[C:\Users\anders.wind\Documents\0.Projects\AlipesQuant\alcc\build\market_data\market_data.vcxproj]
with
[
T=std::shared_ptr<arrow::io::OutputStream>
]
C:\Program Files (x86)\Microsoft Visual
Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\new(33,27): message :
or '_Ty *std::launder<T>(_Ty *) noexcept' [found using argument-dependent
lookup]
[C:\Users\anders.wind\Documents\0.Projects\AlipesQuant\alcc\build\market_data\m
arket_data.vcxproj]
with
[
_Ty=std::shared_ptr<arrow::io::OutputStream>,
T=std::shared_ptr<arrow::io::OutputStream>
]
C:\Users\anders.wind\Miniconda3\envs\quant_env_r20211123_1359_841f2c7e\Library\include\arrow/util/aligned_storage.h(36,1):
message : while trying to match the argument list '(T *)'
[C:\Users\anders.wind\Documents\0.Projects\AlipesQuant\alcc\build\market_data\market_data.vcxproj]
with
[
T=std::shared_ptr<arrow::io::OutputStream>
]
C:\Users\anders.wind\Miniconda3\envs\quant_env_r20211123_1359_841f2c7e\Library\include\arrow/util/aligned_storage.h(36):
message : while compiling class template member function 'T
*arrow::internal::AlignedStorage<T>::get(void) noexcept'
[C:\Users\anders.wind\Documents\0.Projects\Alip
esQuant\alcc\build\market_data\market_data.vcxproj]
with
[
T=std::shared_ptr<arrow::io::OutputStream>
]
C:\Users\anders.wind\Miniconda3\envs\quant_env_r20211123_1359_841f2c7e\Library\include\arrow/result.h(424):
message : see reference to function template instantiation 'T
*arrow::internal::AlignedStorage<T>::get(void) noexcept' being compiled
[C:\Users\anders.wind\Documents\0.Projects\
AlipesQuant\alcc\build\market_data\market_data.vcxproj]
with
[
T=std::shared_ptr<arrow::io::OutputStream>
]
C:\Users\anders.wind\Miniconda3\envs\quant_env_r20211123_1359_841f2c7e\Library\include\arrow/result.h(435):
message : see reference to class template instantiation
'arrow::internal::AlignedStorage<T>' being compiled
[C:\Users\anders.wind\Documents\0.Projects\AlipesQuant\alcc\build\mar
ket_data\market_data.vcxproj]
with
[
T=std::shared_ptr<arrow::io::OutputStream>
]
C:\Users\anders.wind\Documents\0.Projects\AlipesQuant\alcc\astl\include\astl/arrow_helpers.h(86):
message : see reference to class template instantiation
'arrow::Result<std::shared_ptr<arrow::io::OutputStream>>' being compiled
[C:\Users\anders.wind\Documents\0.Projects\AlipesQuant\alc
c\build\market_data\market_data.vcxproj]
C:\Users\anders.wind\Miniconda3\envs\quant_env_r20211123_1359_841f2c7e\Library\include\arrow/util/aligned_storage.h(36,1):
error C2668: 'arrow::internal::launder': ambiguous call to overloaded function
[C:\Users\anders.wind\Documents\0.Projects\AlipesQuant\alcc\build\simulation\simula
te.vcxproj]
C:\Users\anders.wind\Miniconda3\envs\quant_env_r20211123_1359_841f2c7e\Library\include\arrow/util/launder.h(29,14):
message : could be 'T *arrow::internal::launder<T>(T *) noexcept'
[C:\Users\anders.wind\Documents\0.Projects\AlipesQuant\alcc\build\simulation\simulate.vcxproj]
with
[
T=std::shared_ptr<arrow::io::OutputStream>
]
C:\Program Files (x86)\Microsoft Visual
Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\new(33,27): message :
or '_Ty *std::launder<T>(_Ty *) noexcept' [found using argument-dependent
lookup]
[C:\Users\anders.wind\Documents\0.Projects\AlipesQuant\alcc\build\simulation\si
mulate.vcxproj]
with
[
_Ty=std::shared_ptr<arrow::io::OutputStream>,
T=std::shared_ptr<arrow::io::OutputStream>
]
C:\Users\anders.wind\Miniconda3\envs\quant_env_r20211123_1359_841f2c7e\Library\include\arrow/util/aligned_storage.h(36,1):
message : while trying to match the argument list '(T *)'
[C:\Users\anders.wind\Documents\0.Projects\AlipesQuant\alcc\build\simulation\simulate.vcxproj]
with
[
T=std::shared_ptr<arrow::io::OutputStream>
]
C:\Users\anders.wind\Miniconda3\envs\quant_env_r20211123_1359_841f2c7e\Library\include\arrow/util/aligned_storage.h(36):
message : while compiling class template member function 'T
*arrow::internal::AlignedStorage<T>::get(void) noexcept'
[C:\Users\anders.wind\Documents\0.Projects\Alip
esQuant\alcc\build\simulation\simulate.vcxproj]
with
[
T=std::shared_ptr<arrow::io::OutputStream>
]
C:\Users\anders.wind\Miniconda3\envs\quant_env_r20211123_1359_841f2c7e\Library\include\arrow/result.h(424):
message : see reference to function template instantiation 'T
*arrow::internal::AlignedStorage<T>::get(void) noexcept' being compiled
[C:\Users\anders.wind\Documents\0.Projects\
AlipesQuant\alcc\build\simulation\simulate.vcxproj]
with
[
T=std::shared_ptr<arrow::io::OutputStream>
]
C:\Users\anders.wind\Miniconda3\envs\quant_env_r20211123_1359_841f2c7e\Library\include\arrow/result.h(435):
message : see reference to class template instantiation
'arrow::internal::AlignedStorage<T>' being compiled
[C:\Users\anders.wind\Documents\0.Projects\AlipesQuant\alcc\build\sim
ulation\simulate.vcxproj]
with
[
T=std::shared_ptr<arrow::io::OutputStream>
]
C:\Users\anders.wind\Documents\0.Projects\AlipesQuant\alcc\astl\include\astl/arrow_helpers.h(86):
message : see reference to class template instantiation
'arrow::Result<std::shared_ptr<arrow::io::OutputStream>>' being compiled
[C:\Users\anders.wind\Documents\0.Projects\AlipesQuant\alc
c\build\simulation\simulate.vcxproj]
{code}
{{I compile with c++17 flags (but wish to move to c++20)}}
--
This message was sent by Atlassian Jira
(v8.20.1#820001)