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

Non-conformant testing of template-template-args c++ standard feature #2783

Open
mizvekov opened this issue May 9, 2024 · 1 comment
Open

Comments

@mizvekov
Copy link

mizvekov commented May 9, 2024

This project includes workarounds for the changes introduced in https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0522r0.html, which was adopted as a defect report and thus retroactively applies back to all language standards.

See here:

#if defined(__GNUC__) && __GNUC__ > 6 && !defined(__clang__) && __cplusplus >= 201703L

The problem is that this workaround is testing for GCC specifically and C++17, excluding Clang.

GCC has included this change for a while, but it's only enabled by default in C++17 and above, but can be enabled and disabled freely with a flag as well.

Clang has never enabled it by default until now, deferring it to the flag only. This is changing with the next version, where it's going to be enabled in all language versions, and the flag becomes deprecated, to be removed in the version after that.

This means building this project is failing when this feature's enablement differs from default. With the next version of Clang, it's not going to work with the default there either.

Solution: replace above check with testing of standard feature macro: https://en.cppreference.com/w/cpp/feature_test#cpp_template_template_args

References:
llvm/llvm-project#89807
llvm/llvm-project#91504

EthanLuisMcDonough added a commit to EthanLuisMcDonough/xtensor that referenced this issue May 15, 2024
EthanLuisMcDonough added a commit to EthanLuisMcDonough/xtensor that referenced this issue May 15, 2024
@mizvekov
Copy link
Author

There is another place that looks like a candidate for the same fix:

#if defined(__GNUC__) && (__GNUC__ > 6)

A user reported here that this also fixes a similar issue: llvm/llvm-project#89807 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant