Skip to content

Conversation

@tearfur
Copy link
Contributor

@tearfur tearfur commented Jan 15, 2026

Fix compilation on GCC < 8.4 with -fconcepts.

From GCC 8.4 onwards, ISO-19217 concepts -fconcepts are compatible with C++20 concepts thanks to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88075. Edit: Irrelevant

Repro of what I'm trying to fix: https://godbolt.org/z/vv179vWGe

Copy link
Contributor

@vitaut vitaut left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR but I think we should only support C++20 concepts.

using is_formattable = bool_constant<!std::is_same<
detail::mapped_t<conditional_t<std::is_void<T>::value, int*, T>, Char>,
void>::value>;
#ifdef __cpp_concepts
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To elaborate: we should only check __cpp_concepts >= 201907L here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

13c1cbc Updated.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

9ab39ba Updated again to fix -Wundef warning.

@tearfur tearfur changed the title Support ISO 19217 concepts Fix C++20 concept detection Jan 16, 2026
@vitaut vitaut merged commit a9ea225 into fmtlib:master Jan 16, 2026
80 of 89 checks passed
@vitaut
Copy link
Contributor

vitaut commented Jan 16, 2026

Merged, thanks for the fix!

@tearfur tearfur deleted the ISO-19217 branch January 16, 2026 19:13
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.

2 participants