You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[C++][MSVC] Arrow failed to build with MSVC under /std:c++latest mode due to error C2280: 'std::basic_string<char,std::char_traits<char>,std::allocator<char>>::basic_string(std::nullptr_t)': attempting to reference a deleted function
#35501
Closed
Zhaojun-Liu opened this issue
May 9, 2023
· 5 comments
· Fixed by #35683
Describe the bug, including details regarding any error messages, version, and platform.
Hi all,
Recently, we updated the commit of Arrow, and it failed to build with MSVC due to below error on Windows with option /std:c++latest: error C2280: 'std::basic_string<char,std::char_traits<char>,std::allocator<char>>::basic_string(std::nullptr_t)': attempting to reference a deleted function
Could you please help look this issue? Thanks.
Actual result: F:\gitP\apache\arrow\cpp\src\arrow/compute/function_internal.h(289,3): error C2280: 'std::basic_string<char,std::char_traits<char>,std::allocator<char>>::basic_string(std::nullptr_t)': attempting to reference a deleted function [F:\gitP\apache\arrow\cpp\build_amd64\src\arrow\arrow_static.vcxproj]
Using std::basic_string::basic_string("") instead of std::basic_string::basic_string(std::nullptr_t) is a right approach.
Could you open a pull request with the approach?
Using std::basic_string::basic_string("") instead of std::basic_string::basic_string(std::nullptr_t) is a right approach. Could you open a pull request with the approach?
### Rationale for this change
Arrow failed to build with error C2280 under MSVC cpplatest mode, because std::basic_string::basic_string(std::nullptr_t) is deleted since C++23. So, using `std::basic_string::basic_string("")` to replace `std::basic_string::basic_string(std::nullptr_t)` to fix this issue.
Related issue: #35501
### What changes are included in this PR?
### Are these changes tested?
### Are there any user-facing changes?
* Closes: #35501
Authored-by: June Liu (Beyondsoft Corporation) <v-juneliu@microsoft.com>
Signed-off-by: Sutou Kouhei <kou@clear-code.com>
kou
changed the title
[MSVC] Arrow failed to build with MSVC under /std:c++latest mode due to error C2280: 'std::basic_string<char,std::char_traits<char>,std::allocator<char>>::basic_string(std::nullptr_t)': attempting to reference a deleted function
[C++][MSVC] Arrow failed to build with MSVC under /std:c++latest mode due to error C2280: 'std::basic_string<char,std::char_traits<char>,std::allocator<char>>::basic_string(std::nullptr_t)': attempting to reference a deleted function
May 22, 2023
Describe the bug, including details regarding any error messages, version, and platform.
Hi all,
Recently, we updated the commit of Arrow, and it failed to build with MSVC due to below error on Windows with option /std:c++latest:
error C2280: 'std::basic_string<char,std::char_traits<char>,std::allocator<char>>::basic_string(std::nullptr_t)': attempting to reference a deleted function
Could you please help look this issue? Thanks.
Repro steps:
The commit we use: f9324b7
Expected result:
Build successfully.
Actual result:
F:\gitP\apache\arrow\cpp\src\arrow/compute/function_internal.h(289,3): error C2280: 'std::basic_string<char,std::char_traits<char>,std::allocator<char>>::basic_string(std::nullptr_t)': attempting to reference a deleted function [F:\gitP\apache\arrow\cpp\build_amd64\src\arrow\arrow_static.vcxproj]
Detailed log:
build.log
Component(s)
C++
The text was updated successfully, but these errors were encountered: