Skip to content

[C++] mockfs.cc fails to build with -DCMAKE_CXX_STANDARD=23 #46998

Description

@zhjwpku

Describe the bug, including details regarding any error messages, version, and platform.

On MacOS, I use the following command to configure arrow:

cmake ../cpp/ -DARROW_FILESYSTEM=ON -DARROW_PARQUET=ON -DARROW_POSITION_INDEPENDENT_CODE=ON -DARROW_BUILD_SHARED=ON -DARROW_WITH_ZLIB=ON -DZLIB_SOURCE=SYSTEM -DARROW_DEPENDENCY_SOURCE=BUNDLED -DCMAKE_CXX_STANDARD=23

Compiler:

Apple clang version 17.0.0 (clang-1700.0.13.5)
Target: x86_64-apple-darwin24.3.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

The compile fails on mockfs.cc with the following error:

/Library/Developer/CommandLineTools/SDKs/MacOSX15.5.sdk/usr/include/c++/v1/__memory/unique_ptr.h:79:19: error: invalid application of 'sizeof' to an incomplete type 'arrow::fs::internal::(anonymous namespace)::Entry'
79 | static_assert(sizeof(_Tp) >= 0, "cannot delete an incomplete type");
| ^~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX15.5.sdk/usr/include/c++/v1/__memory/unique_ptr.h:293:7: note: in instantiation of member function 'std::default_delete<arrow::fs::internal::(anonymous namespace)::Entry>::operator()' requested here
293 | __ptr_.second()(__tmp);
| ^
/Library/Developer/CommandLineTools/SDKs/MacOSX15.5.sdk/usr/include/c++/v1/__memory/unique_ptr.h:233:5: note: in instantiation of member function 'std::unique_ptr<arrow::fs::internal::(anonymous namespace)::Entry>::reset' requested here
233 | reset(__u.release());
| ^
/Users/zhjwpku/zhjwpku/arrow/cpp/src/arrow/filesystem/mockfs.cc:113:16: note: in instantiation of member function 'std::unique_ptr<arrow::fs::internal::(anonymous namespace)::Entry>::operator=' requested here
113 | entries[s] = std::move(entry);
| ^
/Users/zhjwpku/zhjwpku/arrow/cpp/src/arrow/filesystem/mockfs.cc:57:7: note: forward declaration of 'arrow::fs::internal::(anonymous namespace)::Entry'
57 | class Entry;
| ^
1 error generated.

Component(s)

C++

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions