Closed BurningEnlightenment closed 1 year ago
Sorry about writing failing code :)
The fix should be easy, declare the function before the friend declaration so it gets the LLFIO_HEADERS_ONLY_FUNC_SPEC
, then the friend declaration probably can make do without it. I say "probably" because other compilers may complain if the friend declaration doesn't exactly match the earlier declaration.
Currently at a WG21 meeting in person so time is limited.
The fix should be easy, declare the function before the friend declaration so it gets the
LLFIO_HEADERS_ONLY_FUNC_SPEC
, then the friend declaration probably can make do without it.
Luckily that declaration already exists at an approppriate place :)
I say "probably" because other compilers may complain if the friend declaration doesn't exactly match the earlier declaration.
That thought kept me from just commit a fix. However, I will just go ahead and prepare a PR.
Currently at a WG21 meeting in person so time is limited.
No worries, clang-cl
isn't a primary target platform for me. I've actually procrastinated reporting this for a year or two 😅. So delaying by a week or two doesn't really matter.
Godspeed to you and your proposals.
Describe the bug
clang-cl
fails to compilefs_handle.hpp/to_win32_path
due to the friend declaration containing theextern
linkage specifier.https://github.com/ned14/llfio/blob/f8d2eebeb1742a5ebec4da856d47ba6fd1a48a8c/include/llfio/v2.0/fs_handle.hpp#L121-L122 https://github.com/ned14/llfio/blob/f8d2eebeb1742a5ebec4da856d47ba6fd1a48a8c/include/llfio/v2.0/fs_handle.hpp#L156-L157
To Reproduce / MCVE
clang-cl.exe /nologo -TP -DLLFIO_EXPERIMENTAL_STATUS_CODE=1 -DLLFIO_HEADERS_ONLY=0 -DOUTCOME_USE_SYSTEM_STATUS_CODE=1 -DQUICKCPPLIB_ENABLE_VALGRIND=1 -imsvcbuild\x64-windows-clang\vcpkg_installed\x64-windows-static\include /DWIN32 /D_WINDOWS /EHsc /Zi /Ob0 /Od /RTC1 -MTd -std:c++20 /showIncludes -c -- mcve.cpp
Expected behavior No compiler error.
Environment
Additional context I'm unsure what the preferred fix would be:
…_FUNC_SPEC
macro from the friend declaration (l. 157)…_FUNC_SPEC
to support friend declarations (i.e.…_FUNC_SPEC
withoutextern
).There is one additional occurence: https://github.com/ned14/llfio/blob/f8d2eebeb1742a5ebec4da856d47ba6fd1a48a8c/include/llfio/v2.0/detail/impl/posix/test/io_uring_multiplexer.ipp#L100