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++] Can't build with GCC 14 #40009

Closed
kou opened this issue Feb 9, 2024 · 1 comment · Fixed by #40010
Closed

[C++] Can't build with GCC 14 #40009

kou opened this issue Feb 9, 2024 · 1 comment · Fixed by #40010

Comments

@kou
Copy link
Member

kou commented Feb 9, 2024

Describe the enhancement requested

FAILED: src/arrow/CMakeFiles/arrow_objlib.dir/filesystem/util_internal.cc.o 
/bin/ccache /bin/g++-14 -DARROW_EXPORTING -DARROW_EXTRA_ERROR_CONTEXT -DARROW_HAVE_RUNTIME_AVX2 -DARROW_HAVE_RUNTIME_AVX512 -DARROW_HAVE_RUNTIME_BMI2 -DARROW_HAVE_RUNTIME_SSE4_2 -DARROW_HAVE_SSE4_2 -DARROW_HDFS -DARROW_MIMALLOC -DARROW_WITH_BACKTRACE -DARROW_WITH_BROTLI -DARROW_WITH_BZ2 -DARROW_WITH_LZ4 -DARROW_WITH_RE2 -DARROW_WITH_SNAPPY -DARROW_WITH_TIMING_TESTS -DARROW_WITH_UTF8PROC -DARROW_WITH_ZLIB -DARROW_WITH_ZSTD -DAZ_RTTI -DBOOST_ALL_NO_LIB -DURI_STATIC_BUILD -I/home/kou/work/cpp/arrow.kou/cpp.build/src -I/home/kou/work/cpp/arrow.kou/cpp/src -I/home/kou/work/cpp/arrow.kou/cpp/src/generated -I/home/kou/work/cpp/arrow.kou/cpp.build/_deps/azure_sdk-src/sdk/storage/azure-storage-files-datalake/inc -I/home/kou/work/cpp/arrow.kou/cpp.build/_deps/azure_sdk-src/sdk/storage/azure-storage-blobs/inc -I/home/kou/work/cpp/arrow.kou/cpp.build/_deps/azure_sdk-src/sdk/storage/azure-storage-common/inc -I/home/kou/work/cpp/arrow.kou/cpp.build/_deps/azure_sdk-src/sdk/core/azure-core/inc -I/home/kou/work/cpp/arrow.kou/cpp.build/_deps/azure_sdk-src/sdk/identity/azure-identity/inc -isystem /home/kou/work/cpp/arrow.kou/cpp/thirdparty/flatbuffers/include -isystem /home/kou/work/cpp/arrow.kou/cpp/thirdparty/hadoop/include -isystem /home/kou/work/cpp/arrow.kou/cpp.build/google_cloud_cpp_ep-install/include -isystem /home/kou/work/cpp/arrow.kou/cpp.build/crc32c_ep-install/include -isystem /home/kou/work/cpp/arrow.kou/cpp.build/orc_ep-install/include -isystem /home/kou/work/cpp/arrow.kou/cpp.build/awssdk_ep-install/include -isystem /home/kou/work/cpp/arrow.kou/cpp.build/jemalloc_ep-prefix/src -isystem /home/kou/work/cpp/arrow.kou/cpp.build/mimalloc_ep/src/mimalloc_ep/include/mimalloc-2.0 -Wno-noexcept-type -Wno-self-move  -fdiagnostics-color=always  -Wall -Wno-conversion -Wno-sign-conversion -Wunused-result -Wdate-time -fno-semantic-interposition -msse4.2  -g -Werror -O0 -ggdb -g3 -std=c++17 -fPIC -MD -MT src/arrow/CMakeFiles/arrow_objlib.dir/filesystem/util_internal.cc.o -MF src/arrow/CMakeFiles/arrow_objlib.dir/filesystem/util_internal.cc.o.d -o src/arrow/CMakeFiles/arrow_objlib.dir/filesystem/util_internal.cc.o -c /home/kou/work/cpp/arrow.kou/cpp/src/arrow/filesystem/util_internal.cc
/home/kou/work/cpp/arrow.kou/cpp/src/arrow/filesystem/util_internal.cc: In function ‘arrow::Result<std::__cxx11::basic_string<char> > arrow::fs::internal::PathFromUriHelper(const std::string&, std::vector<std::__cxx11::basic_string<char> >, bool, AuthorityHandlingBehavior)’:
/home/kou/work/cpp/arrow.kou/cpp/src/arrow/filesystem/util_internal.cc:143:16: error: no matching function for call to ‘find(std::vector<std::__cxx11::basic_string<char> >::iterator, std::vector<std::__cxx11::basic_string<char> >::iterator, const std::__cxx11::basic_string<char>&)’
  143 |   if (std::find(supported_schemes.begin(), supported_schemes.end(), scheme) ==
      |       ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/bits/locale_facets.h:48,
                 from /usr/include/c++/14/bits/basic_ios.h:37,
                 from /usr/include/c++/14/ios:46,
                 from /usr/include/c++/14/ostream:40,
                 from /home/kou/work/cpp/arrow.kou/cpp/src/arrow/util/string_builder.h:21,
                 from /home/kou/work/cpp/arrow.kou/cpp/src/arrow/status.h:25,
                 from /home/kou/work/cpp/arrow.kou/cpp/src/arrow/util/cancel.h:25,
                 from /home/kou/work/cpp/arrow.kou/cpp/src/arrow/io/interfaces.h:28,
                 from /home/kou/work/cpp/arrow.kou/cpp/src/arrow/filesystem/filesystem.h:30,
                 from /home/kou/work/cpp/arrow.kou/cpp/src/arrow/filesystem/util_internal.h:24,
                 from /home/kou/work/cpp/arrow.kou/cpp/src/arrow/filesystem/util_internal.cc:18:
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: ‘template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT, std::char_traits<_CharT> > >::__type std::find(istreambuf_iterator<_CharT, char_traits<_CharT> >, istreambuf_iterator<_CharT, char_traits<_CharT> >, const _CharT2&)’
  435 |     find(istreambuf_iterator<_CharT> __first,
      |     ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note:   template argument deduction/substitution failed:
/home/kou/work/cpp/arrow.kou/cpp/src/arrow/filesystem/util_internal.cc:143:16: note:   ‘__gnu_cxx::__normal_iterator<std::__cxx11::basic_string<char>*, std::vector<std::__cxx11::basic_string<char> > >’ is not derived from ‘std::istreambuf_iterator<_CharT, std::char_traits<_CharT> >’
  143 |   if (std::find(supported_schemes.begin(), supported_schemes.end(), scheme) ==
      |       ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Component(s)

C++

@kou
Copy link
Member Author

kou commented Feb 9, 2024

Note that GCC 14 isn't released yet.

kou added a commit to kou/arrow that referenced this issue Feb 9, 2024
`std::find()` is defined in `<algorithm>`. If we don't include
`<algorithm>` explicitly, g++-14 complains:

    cpp/src/arrow/filesystem/util_internal.cc: In function 'arrow::Result<std::__cxx11::basic_string<char> > arrow::fs::internal::PathFromUriHelper(const std::string&, std::vector<std::__cxx11::basic_string<char> >, bool, AuthorityHandlingBehavior)':
    cpp/src/arrow/filesystem/util_internal.cc:143:16: error: no matching function for call to 'find(std::vector<std::__cxx11::basic_string<char> >::iterator, std::vector<std::__cxx11::basic_string<char> >::iterator, const std::__cxx11::basic_string<char>&)'
      143 |   if (std::find(supported_schemes.begin(), supported_schemes.end(), scheme) ==
          |       ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT, std::char_traits<_CharT> > >::__type std::find(istreambuf_iterator<_CharT, char_traits<_CharT> >, istreambuf_iterator<_CharT, char_traits<_CharT> >, const _CharT2&)'
      435 |     find(istreambuf_iterator<_CharT> __first,
          |     ^~~~
    /usr/include/c++/14/bits/streambuf_iterator.h:435:5: note:   template argument deduction/substitution failed:
    cpp/src/arrow/filesystem/util_internal.cc:143:16: note:   '__gnu_cxx::__normal_iterator<std::__cxx11::basic_string<char>*, std::vector<std::__cxx11::basic_string<char> > >' is not derived from 'std::istreambuf_iterator<_CharT, std::char_traits<_CharT> >'
      143 |   if (std::find(supported_schemes.begin(), supported_schemes.end(), scheme) ==
          |       ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
assignUser pushed a commit that referenced this issue Feb 9, 2024
### Rationale for this change

`std::find()` is defined in `<algorithm>`. If we don't include `<algorithm>` explicitly, g++-14 complains:

    cpp/src/arrow/filesystem/util_internal.cc: In function 'arrow::Result<std::__cxx11::basic_string<char> > arrow::fs::internal::PathFromUriHelper(const std::string&, std::vector<std::__cxx11::basic_string<char> >, bool, AuthorityHandlingBehavior)':
    cpp/src/arrow/filesystem/util_internal.cc:143:16: error: no matching function for call to 'find(std::vector<std::__cxx11::basic_string<char> >::iterator, std::vector<std::__cxx11::basic_string<char> >::iterator, const std::__cxx11::basic_string<char>&)'
      143 |   if (std::find(supported_schemes.begin(), supported_schemes.end(), scheme) ==
          |       ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT, std::char_traits<_CharT> > >::__type std::find(istreambuf_iterator<_CharT, char_traits<_CharT> >, istreambuf_iterator<_CharT, char_traits<_CharT> >, const _CharT2&)'
      435 |     find(istreambuf_iterator<_CharT> __first,
          |     ^~~~
    /usr/include/c++/14/bits/streambuf_iterator.h:435:5: note:   template argument deduction/substitution failed:
    cpp/src/arrow/filesystem/util_internal.cc:143:16: note:   '__gnu_cxx::__normal_iterator<std::__cxx11::basic_string<char>*, std::vector<std::__cxx11::basic_string<char> > >' is not derived from 'std::istreambuf_iterator<_CharT, std::char_traits<_CharT> >'
      143 |   if (std::find(supported_schemes.begin(), supported_schemes.end(), scheme) ==
          |       ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

### What changes are included in this PR?

Include `<algorithm>` explicitly.

### Are these changes tested?

Yes.

### Are there any user-facing changes?

No.
* Closes: #40009

Authored-by: Sutou Kouhei <kou@clear-code.com>
Signed-off-by: Jacob Wujciak-Jens <jacob@wujciak.de>
@assignUser assignUser added this to the 16.0.0 milestone Feb 9, 2024
assignUser pushed a commit that referenced this issue Feb 9, 2024
### Rationale for this change

`std::find()` is defined in `<algorithm>`. If we don't include `<algorithm>` explicitly, g++-14 complains:

    cpp/src/arrow/filesystem/util_internal.cc: In function 'arrow::Result<std::__cxx11::basic_string<char> > arrow::fs::internal::PathFromUriHelper(const std::string&, std::vector<std::__cxx11::basic_string<char> >, bool, AuthorityHandlingBehavior)':
    cpp/src/arrow/filesystem/util_internal.cc:143:16: error: no matching function for call to 'find(std::vector<std::__cxx11::basic_string<char> >::iterator, std::vector<std::__cxx11::basic_string<char> >::iterator, const std::__cxx11::basic_string<char>&)'
      143 |   if (std::find(supported_schemes.begin(), supported_schemes.end(), scheme) ==
          |       ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT, std::char_traits<_CharT> > >::__type std::find(istreambuf_iterator<_CharT, char_traits<_CharT> >, istreambuf_iterator<_CharT, char_traits<_CharT> >, const _CharT2&)'
      435 |     find(istreambuf_iterator<_CharT> __first,
          |     ^~~~
    /usr/include/c++/14/bits/streambuf_iterator.h:435:5: note:   template argument deduction/substitution failed:
    cpp/src/arrow/filesystem/util_internal.cc:143:16: note:   '__gnu_cxx::__normal_iterator<std::__cxx11::basic_string<char>*, std::vector<std::__cxx11::basic_string<char> > >' is not derived from 'std::istreambuf_iterator<_CharT, std::char_traits<_CharT> >'
      143 |   if (std::find(supported_schemes.begin(), supported_schemes.end(), scheme) ==
          |       ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

### What changes are included in this PR?

Include `<algorithm>` explicitly.

### Are these changes tested?

Yes.

### Are there any user-facing changes?

No.
* Closes: #40009

Authored-by: Sutou Kouhei <kou@clear-code.com>
Signed-off-by: Jacob Wujciak-Jens <jacob@wujciak.de>
thisisnic pushed a commit to thisisnic/arrow that referenced this issue Feb 10, 2024
### Rationale for this change

`std::find()` is defined in `<algorithm>`. If we don't include `<algorithm>` explicitly, g++-14 complains:

    cpp/src/arrow/filesystem/util_internal.cc: In function 'arrow::Result<std::__cxx11::basic_string<char> > arrow::fs::internal::PathFromUriHelper(const std::string&, std::vector<std::__cxx11::basic_string<char> >, bool, AuthorityHandlingBehavior)':
    cpp/src/arrow/filesystem/util_internal.cc:143:16: error: no matching function for call to 'find(std::vector<std::__cxx11::basic_string<char> >::iterator, std::vector<std::__cxx11::basic_string<char> >::iterator, const std::__cxx11::basic_string<char>&)'
      143 |   if (std::find(supported_schemes.begin(), supported_schemes.end(), scheme) ==
          |       ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT, std::char_traits<_CharT> > >::__type std::find(istreambuf_iterator<_CharT, char_traits<_CharT> >, istreambuf_iterator<_CharT, char_traits<_CharT> >, const _CharT2&)'
      435 |     find(istreambuf_iterator<_CharT> __first,
          |     ^~~~
    /usr/include/c++/14/bits/streambuf_iterator.h:435:5: note:   template argument deduction/substitution failed:
    cpp/src/arrow/filesystem/util_internal.cc:143:16: note:   '__gnu_cxx::__normal_iterator<std::__cxx11::basic_string<char>*, std::vector<std::__cxx11::basic_string<char> > >' is not derived from 'std::istreambuf_iterator<_CharT, std::char_traits<_CharT> >'
      143 |   if (std::find(supported_schemes.begin(), supported_schemes.end(), scheme) ==
          |       ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

### What changes are included in this PR?

Include `<algorithm>` explicitly.

### Are these changes tested?

Yes.

### Are there any user-facing changes?

No.
* Closes: apache#40009

Authored-by: Sutou Kouhei <kou@clear-code.com>
Signed-off-by: Jacob Wujciak-Jens <jacob@wujciak.de>
thisisnic added a commit that referenced this issue Feb 10, 2024
### Rationale for this change

Cherry-pick `GH-40009: [C++] Add missing "#include <algorithm>"` into
the CRAN release branch

### Are these changes tested?

Yes.

### Are there any user-facing changes?

No.

### Rationale for this change

This change was added after the branch was created

### What changes are included in this PR?

GH-40009: [C++] Add missing "#include <algorithm>"

### Are these changes tested?

No

### Are there any user-facing changes?

No

Signed-off-by: Jacob Wujciak-Jens <jacob@wujciak.de>
Co-authored-by: Sutou Kouhei <kou@clear-code.com>
@pitrou pitrou modified the milestones: 16.0.0, 15.0.1 Feb 14, 2024
dgreiss pushed a commit to dgreiss/arrow that referenced this issue Feb 19, 2024
### Rationale for this change

`std::find()` is defined in `<algorithm>`. If we don't include `<algorithm>` explicitly, g++-14 complains:

    cpp/src/arrow/filesystem/util_internal.cc: In function 'arrow::Result<std::__cxx11::basic_string<char> > arrow::fs::internal::PathFromUriHelper(const std::string&, std::vector<std::__cxx11::basic_string<char> >, bool, AuthorityHandlingBehavior)':
    cpp/src/arrow/filesystem/util_internal.cc:143:16: error: no matching function for call to 'find(std::vector<std::__cxx11::basic_string<char> >::iterator, std::vector<std::__cxx11::basic_string<char> >::iterator, const std::__cxx11::basic_string<char>&)'
      143 |   if (std::find(supported_schemes.begin(), supported_schemes.end(), scheme) ==
          |       ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT, std::char_traits<_CharT> > >::__type std::find(istreambuf_iterator<_CharT, char_traits<_CharT> >, istreambuf_iterator<_CharT, char_traits<_CharT> >, const _CharT2&)'
      435 |     find(istreambuf_iterator<_CharT> __first,
          |     ^~~~
    /usr/include/c++/14/bits/streambuf_iterator.h:435:5: note:   template argument deduction/substitution failed:
    cpp/src/arrow/filesystem/util_internal.cc:143:16: note:   '__gnu_cxx::__normal_iterator<std::__cxx11::basic_string<char>*, std::vector<std::__cxx11::basic_string<char> > >' is not derived from 'std::istreambuf_iterator<_CharT, std::char_traits<_CharT> >'
      143 |   if (std::find(supported_schemes.begin(), supported_schemes.end(), scheme) ==
          |       ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

### What changes are included in this PR?

Include `<algorithm>` explicitly.

### Are these changes tested?

Yes.

### Are there any user-facing changes?

No.
* Closes: apache#40009

Authored-by: Sutou Kouhei <kou@clear-code.com>
Signed-off-by: Jacob Wujciak-Jens <jacob@wujciak.de>
raulcd pushed a commit that referenced this issue Feb 20, 2024
### Rationale for this change

`std::find()` is defined in `<algorithm>`. If we don't include `<algorithm>` explicitly, g++-14 complains:

    cpp/src/arrow/filesystem/util_internal.cc: In function 'arrow::Result<std::__cxx11::basic_string<char> > arrow::fs::internal::PathFromUriHelper(const std::string&, std::vector<std::__cxx11::basic_string<char> >, bool, AuthorityHandlingBehavior)':
    cpp/src/arrow/filesystem/util_internal.cc:143:16: error: no matching function for call to 'find(std::vector<std::__cxx11::basic_string<char> >::iterator, std::vector<std::__cxx11::basic_string<char> >::iterator, const std::__cxx11::basic_string<char>&)'
      143 |   if (std::find(supported_schemes.begin(), supported_schemes.end(), scheme) ==
          |       ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT, std::char_traits<_CharT> > >::__type std::find(istreambuf_iterator<_CharT, char_traits<_CharT> >, istreambuf_iterator<_CharT, char_traits<_CharT> >, const _CharT2&)'
      435 |     find(istreambuf_iterator<_CharT> __first,
          |     ^~~~
    /usr/include/c++/14/bits/streambuf_iterator.h:435:5: note:   template argument deduction/substitution failed:
    cpp/src/arrow/filesystem/util_internal.cc:143:16: note:   '__gnu_cxx::__normal_iterator<std::__cxx11::basic_string<char>*, std::vector<std::__cxx11::basic_string<char> > >' is not derived from 'std::istreambuf_iterator<_CharT, std::char_traits<_CharT> >'
      143 |   if (std::find(supported_schemes.begin(), supported_schemes.end(), scheme) ==
          |       ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

### What changes are included in this PR?

Include `<algorithm>` explicitly.

### Are these changes tested?

Yes.

### Are there any user-facing changes?

No.
* Closes: #40009

Authored-by: Sutou Kouhei <kou@clear-code.com>
Signed-off-by: Jacob Wujciak-Jens <jacob@wujciak.de>
zanmato1984 pushed a commit to zanmato1984/arrow that referenced this issue Feb 28, 2024
### Rationale for this change

`std::find()` is defined in `<algorithm>`. If we don't include `<algorithm>` explicitly, g++-14 complains:

    cpp/src/arrow/filesystem/util_internal.cc: In function 'arrow::Result<std::__cxx11::basic_string<char> > arrow::fs::internal::PathFromUriHelper(const std::string&, std::vector<std::__cxx11::basic_string<char> >, bool, AuthorityHandlingBehavior)':
    cpp/src/arrow/filesystem/util_internal.cc:143:16: error: no matching function for call to 'find(std::vector<std::__cxx11::basic_string<char> >::iterator, std::vector<std::__cxx11::basic_string<char> >::iterator, const std::__cxx11::basic_string<char>&)'
      143 |   if (std::find(supported_schemes.begin(), supported_schemes.end(), scheme) ==
          |       ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT, std::char_traits<_CharT> > >::__type std::find(istreambuf_iterator<_CharT, char_traits<_CharT> >, istreambuf_iterator<_CharT, char_traits<_CharT> >, const _CharT2&)'
      435 |     find(istreambuf_iterator<_CharT> __first,
          |     ^~~~
    /usr/include/c++/14/bits/streambuf_iterator.h:435:5: note:   template argument deduction/substitution failed:
    cpp/src/arrow/filesystem/util_internal.cc:143:16: note:   '__gnu_cxx::__normal_iterator<std::__cxx11::basic_string<char>*, std::vector<std::__cxx11::basic_string<char> > >' is not derived from 'std::istreambuf_iterator<_CharT, std::char_traits<_CharT> >'
      143 |   if (std::find(supported_schemes.begin(), supported_schemes.end(), scheme) ==
          |       ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

### What changes are included in this PR?

Include `<algorithm>` explicitly.

### Are these changes tested?

Yes.

### Are there any user-facing changes?

No.
* Closes: apache#40009

Authored-by: Sutou Kouhei <kou@clear-code.com>
Signed-off-by: Jacob Wujciak-Jens <jacob@wujciak.de>
kou pushed a commit that referenced this issue Mar 1, 2024
This is an attempt to make sure we catching things like the issue we ran into in #40009 in CI so that we could confirm that we don't run into this in the future. CRAN does runs using pre-release compilers, and we've hit this a time or two. We can wait for them to come and tell us we need to move in order to stay up, but it would be nice if we could detect this ourselves. And more importantly: it gives us a hopefully easier we to replicate the error and confirm we've fixed it so that we can have confidence when we submit. 

``` [1m/tmp/RtmpLtR2pg/R.INSTALL1d415a4f31ad3b/arrow/tools/cpp/src/arrow/filesystem/util_internal.cc:143:7:  [0m [0;1;31merror:  [0m [1mno matching function for call to 'find' [0m
  143 |   if (std::find(supported_schemes.begin(), supported_schemes.end(), scheme) == [0m
      |  [0;1;32m      ^~~~~~~~~
 [0m [1m/usr/bin/../lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/streambuf_iterator.h:435:5:  [0m [0;1;30mnote:  [0mcandidate template ignored: could not match 'istreambuf_iterator' against '__normal_iterator' [0m
  435 |     find(istreambuf_iterator<_CharT> __first, [0m
      |  [0;1;32m    ^
 [0m1 error generated.
``` 

#40244 (comment) is a run before our fix showing the same failure.

I've also downloaded + saved the log from CRAN since it will be overwritten soon now that we have a new release up: [Install log for 'arrow' with clang dev.txt](https://github.com/apache/arrow/files/14407630/Install.log.for.arrow.with.clang.dev.txt)

* GitHub Issue: #40212

Authored-by: Jonathan Keane <jkeane@gmail.com>
Signed-off-by: Sutou Kouhei <kou@clear-code.com>
thisisnic pushed a commit to thisisnic/arrow that referenced this issue Mar 8, 2024
### Rationale for this change

`std::find()` is defined in `<algorithm>`. If we don't include `<algorithm>` explicitly, g++-14 complains:

    cpp/src/arrow/filesystem/util_internal.cc: In function 'arrow::Result<std::__cxx11::basic_string<char> > arrow::fs::internal::PathFromUriHelper(const std::string&, std::vector<std::__cxx11::basic_string<char> >, bool, AuthorityHandlingBehavior)':
    cpp/src/arrow/filesystem/util_internal.cc:143:16: error: no matching function for call to 'find(std::vector<std::__cxx11::basic_string<char> >::iterator, std::vector<std::__cxx11::basic_string<char> >::iterator, const std::__cxx11::basic_string<char>&)'
      143 |   if (std::find(supported_schemes.begin(), supported_schemes.end(), scheme) ==
          |       ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT, std::char_traits<_CharT> > >::__type std::find(istreambuf_iterator<_CharT, char_traits<_CharT> >, istreambuf_iterator<_CharT, char_traits<_CharT> >, const _CharT2&)'
      435 |     find(istreambuf_iterator<_CharT> __first,
          |     ^~~~
    /usr/include/c++/14/bits/streambuf_iterator.h:435:5: note:   template argument deduction/substitution failed:
    cpp/src/arrow/filesystem/util_internal.cc:143:16: note:   '__gnu_cxx::__normal_iterator<std::__cxx11::basic_string<char>*, std::vector<std::__cxx11::basic_string<char> > >' is not derived from 'std::istreambuf_iterator<_CharT, std::char_traits<_CharT> >'
      143 |   if (std::find(supported_schemes.begin(), supported_schemes.end(), scheme) ==
          |       ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

### What changes are included in this PR?

Include `<algorithm>` explicitly.

### Are these changes tested?

Yes.

### Are there any user-facing changes?

No.
* Closes: apache#40009

Authored-by: Sutou Kouhei <kou@clear-code.com>
Signed-off-by: Jacob Wujciak-Jens <jacob@wujciak.de>
thisisnic pushed a commit to thisisnic/arrow that referenced this issue Mar 8, 2024
This is an attempt to make sure we catching things like the issue we ran into in apache#40009 in CI so that we could confirm that we don't run into this in the future. CRAN does runs using pre-release compilers, and we've hit this a time or two. We can wait for them to come and tell us we need to move in order to stay up, but it would be nice if we could detect this ourselves. And more importantly: it gives us a hopefully easier we to replicate the error and confirm we've fixed it so that we can have confidence when we submit. 

``` [1m/tmp/RtmpLtR2pg/R.INSTALL1d415a4f31ad3b/arrow/tools/cpp/src/arrow/filesystem/util_internal.cc:143:7:  [0m [0;1;31merror:  [0m [1mno matching function for call to 'find' [0m
  143 |   if (std::find(supported_schemes.begin(), supported_schemes.end(), scheme) == [0m
      |  [0;1;32m      ^~~~~~~~~
 [0m [1m/usr/bin/../lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/streambuf_iterator.h:435:5:  [0m [0;1;30mnote:  [0mcandidate template ignored: could not match 'istreambuf_iterator' against '__normal_iterator' [0m
  435 |     find(istreambuf_iterator<_CharT> __first, [0m
      |  [0;1;32m    ^
 [0m1 error generated.
``` 

apache#40244 (comment) is a run before our fix showing the same failure.

I've also downloaded + saved the log from CRAN since it will be overwritten soon now that we have a new release up: [Install log for 'arrow' with clang dev.txt](https://github.com/apache/arrow/files/14407630/Install.log.for.arrow.with.clang.dev.txt)

* GitHub Issue: apache#40212

Authored-by: Jonathan Keane <jkeane@gmail.com>
Signed-off-by: Sutou Kouhei <kou@clear-code.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants