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

Use simplified void_t for all compilers except GCC 4.x #2160

Merged
merged 1 commit into from
Mar 2, 2021

Conversation

alexezeder
Copy link
Contributor

Fixes #2149.

This PR moves a special void_t workaround for GCC 4.x:

fmt/include/fmt/core.h

Lines 1382 to 1385 in 640acba

// A workaround for gcc 4.8 to make void_t work in a SFINAE context.
template <typename... Ts> struct void_t_impl { using type = void; };
template <typename... Ts>
using void_t = typename detail::void_t_impl<Ts...>::type;

under the GCC < 5.0 macro check, adding a straightforward void_t implementation:

template <typename...> using void_t = void;

for other compilers.

This solves the problem with GCC 8.x that fails with the current implementation of void_t.

@vitaut vitaut merged commit d8b9254 into fmtlib:master Mar 2, 2021
@vitaut
Copy link
Contributor

vitaut commented Mar 2, 2021

Thank you!

sthagen added a commit to sthagen/fmtlib-fmt that referenced this pull request Mar 3, 2021
use simplified `void_t` for all compilers other than gcc 4.x (fmtlib#2160)
@alexezeder alexezeder deleted the fix/issue-2149 branch March 8, 2021 00:58
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

Successfully merging this pull request may close these issues.

vformat_to_n(char *) fails to compile with GCC 8.
2 participants