tcbrindle / flux

A C++20 library for sequence-orientated programming
https://tristanbrindle.com/flux/
Boost Software License 1.0
472 stars 29 forks source link

Build Failure with Clang 16.0.6 on Windows #104

Closed DeveloperPaul123 closed 1 year ago

DeveloperPaul123 commented 1 year ago

I'm currently getting this build errors when trying to build using Ninja and Clang 16.0.6 on Windows.

A brief snippet of the errors I'm getting (currently 309 total). ~200 of the errors are complaining that std::source_location can't be found. <source_location> is clearly included and LLVM on Windows depends on Microsoft's STL, so I'm fairly certain that std::source_location is in fact available.

In file included from D:/Repositories/flux/include\flux/core/utils.hpp:9:
D:\Repositories\flux\include\flux\core\assert.hpp(28,33): error G4D3043E2: no type named 'source_location' in namespace 'std'
                             std::source_location loc = std::source_location::current()) const
                             ~~~~~^
D:\Repositories\flux\include\flux\core\assert.hpp(28,60): error G60A5EC10: no member named 'source_location' in namespace 'std'
                             std::source_location loc = std::source_location::current()) const

Another error I'm getting

GAF447572 no matching function for call to 'inc_ra_impl' D:\Repositories\flux\out\build\x64-debug-clang\flux D:\Repositories\flux\include\flux\op\chain.hpp 230 

If you need more details I can try to dig in a bit deeper and try to understand what is going on.

tcbrindle commented 1 year ago

Hi Paul, thanks for filing this :)

Having finally managed to get LLVM Clang working on my Windows box, it seems that std::source_location is indeed unavailable in that environment -- and in fact the macro __cpp_lib_source_location is undefined, which is a bit of a clue...

After a bit of investigation it seems like this PR for the MS STL should enable std::source_location under Clang, but I guess it hasn't made it into a VS release yet.

That being the case, I think the only thing we can do for now is to declare Clang on Windows as unsupported, and try again after the next VS update in case the <source_location> header has been updated. Hopefully most of the other errors are just cascades from source_location code failing, but if there are any other problems we can investigate when the time comes.