You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug] Fails to compile with TBB and XSIMD enabled #2736
Activity
spectre-ns commentedon Oct 31, 2023
Example of failed build
https://github.com/spectre-ns/xtensor/actions/runs/6706077908/job/18221831529
JohanMabille commentedon Nov 1, 2023
I guess we need to capture
needs_casthere, but I wonder if it's a compiler issue. Do you have the same issue with MSVC 2022 ?spectre-ns commentedon Nov 1, 2023
@JohanMabille yes the same issue exists in MSVC 2022
spectre-ns commentedon Nov 1, 2023
@JohanMabille looks like this is a bug as
constexprvariables should be captured in lambda scope implicitly.https://stackoverflow.com/questions/33873788/can-i-use-a-constexpr-value-in-a-lambda-without-capturing-it
Specifically MSVC:
https://stackoverflow.com/questions/71493298/why-cant-a-constexpr-variable-be-seen-only-by-a-capturing-lambda
spectre-ns commentedon Nov 1, 2023
Also there are issues out of the box around tbb defining min and max that need to be mitigated using
#define NOMINMAXspectre-ns commentedon Nov 12, 2023
@tdegeus this issue isn't C++20 specific. Not sure what that label means though.
PerretB commentedon Jul 19, 2024
@spectre-ns @JohanMabille hello, did you find a workaround for this problem? Activating the flag
/Zc:lambdadoes solve the failed capture of the constexpr var in the lambda https://learn.microsoft.com/en-us/cpp/build/reference/zc-lambda?view=msvc-170 . However thesyntax error: 'template'remains on this line (and several others):xtensor/include/xtensor/xassign.hpp
Line 1252 in 8c0a484
spectre-ns commentedon Jul 19, 2024
Hi @PerretB I have not found a workaround. It works in clang and GCC so it is a compiler issue...
brccabral commentedon Sep 25, 2024
This small example triggers the error