Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[C++] Failed to build vendored/datetime/tz.cpp with C++20 and libc++ #43095

Closed
ben-freist opened this issue Jul 1, 2024 · 1 comment
Closed

Comments

@ben-freist
Copy link
Contributor

ben-freist commented Jul 1, 2024

Describe the enhancement requested

CMake command line:

cmake -DARROW_ENABLE_THREADING=OFF \
 -DARROW_JEMALLOC=OFF \
-DCMAKE_CXX_STANDARD=20 \
-DCXX_ONLY_FLAGS="-stdlib=libc++" \
-DCMAKE_TOOLCHAIN_FILE=toolchain.cmake  --preset ninja-debug-minimal   ../cpp/

Error log:

In file included from ~/.conan2/p/b/arrowe39f77e638649/b/src/cpp/src/arrow/vendored/datetime/tz.cpp:90:
~/.conan2/p/b/arrowe39f77e638649/b/src/cpp/src/arrow/vendored/datetime/tz_private.h:295:12: error: use of overloaded operator '<<' is ambiguous (with operand types 'std::ostream' (aka 'basic_ostream<char>') and 'const sys_seconds' (aka 'const time_point<std::chrono::system_clock, std::chrono::duration<long long, std::ratio<1, 1>>>'))
  295 |         os << t.timepoint << "Z ";
      |         ~~ ^  ~~~~~~~~~~~
/usr/lib/llvm-17/bin/../include/c++/v1/__chrono/ostream.h:46:1: note: candidate function [with _CharT = char, _Traits = std::char_traits<char>, _Duration = std::chrono::duration<long long>]
   46 | operator<<(basic_ostream<_CharT, _Traits>& __os, const sys_time<_Duration> __tp) {
      | ^
~/.conan2/p/b/arrowe39f77e638649/b/src/cpp/src/arrow/vendored/datetime/date.h:4214:1: note: candidate function [with CharT = char, Traits = std::char_traits<char>, Duration = std::chrono::duration<long long>]
 4214 | operator<<(std::basic_ostream<CharT, Traits>& os, const sys_time<Duration>& tp)

Component(s)

C++

@kou kou changed the title build arrow c++ with c++ 20 [C++] Build with C++20 Jul 2, 2024
@kou kou changed the title [C++] Build with C++20 [C++] Failed to build vendored/datetime/tz.cpp with C++20 and libc++ Jul 11, 2024
kou pushed a commit that referenced this issue Jul 12, 2024
…g with libc++ and C++20 (#43094)

### Rationale for this change

We can't build with libc++ and C++20:

CMake command line:

```bash
cmake -DARROW_ENABLE_THREADING=OFF \
 -DARROW_JEMALLOC=OFF \
-DCMAKE_CXX_STANDARD=20 \
-DCXX_ONLY_FLAGS="-stdlib=libc++" \
-DCMAKE_TOOLCHAIN_FILE=toolchain.cmake  --preset ninja-debug-minimal   ../cpp/
```

Error log:

```
In file included from ~/.conan2/p/b/arrowe39f77e638649/b/src/cpp/src/arrow/vendored/datetime/tz.cpp:90:
~/.conan2/p/b/arrowe39f77e638649/b/src/cpp/src/arrow/vendored/datetime/tz_private.h:295:12: error: use of overloaded operator '<<' is ambiguous (with operand types 'std::ostream' (aka 'basic_ostream<char>') and 'const sys_seconds' (aka 'const time_point<std::chrono::system_clock, std::chrono::duration<long long, std::ratio<1, 1>>>'))
  295 |         os << t.timepoint << "Z ";
      |         ~~ ^  ~~~~~~~~~~~
/usr/lib/llvm-17/bin/../include/c++/v1/__chrono/ostream.h:46:1: note: candidate function [with _CharT = char, _Traits = std::char_traits<char>, _Duration = std::chrono::duration<long long>]
   46 | operator<<(basic_ostream<_CharT, _Traits>& __os, const sys_time<_Duration> __tp) {
      | ^
~/.conan2/p/b/arrowe39f77e638649/b/src/cpp/src/arrow/vendored/datetime/date.h:4214:1: note: candidate function [with CharT = char, Traits = std::char_traits<char>, Duration = std::chrono::duration<long long>]
 4214 | operator<<(std::basic_ostream<CharT, Traits>& os, const sys_time<Duration>& tp)
```

### What changes are included in this PR?

Update the bundled vendor/datetime because the upstream has changes for this case:
HowardHinnant/date#827

### Are these changes tested?

### Are there any user-facing changes?

* GitHub Issue: #43095

Authored-by: Benjamin Freist <[email protected]>
Signed-off-by: Sutou Kouhei <[email protected]>
@kou kou added this to the 18.0.0 milestone Jul 12, 2024
@kou
Copy link
Member

kou commented Jul 12, 2024

Issue resolved by pull request 43094
#43094

@kou kou closed this as completed Jul 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants