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

Build error Clang < 5.0 constexpr function never produces a constant expression #1587

Closed
scamille opened this issue Mar 11, 2020 · 2 comments

Comments

@scamille
Copy link

I get build errors after upgrading to fmt 6.1.2 when building with clang < 5.0, eg. with clang 3.9

/util/fmt/core.h:735:20: error: constexpr function never produces a constant expression [-Winvalid-constexpr]

FMT_CONSTEXPR bool is_integral_type(type t) {

                   ^

./util/fmt/core.h:736:3: note: both arms of conditional operator are unable to produce a constant expression

  FMT_ASSERT(t != named_arg_type, "invalid argument type");

  ^

./util/fmt/core.h:234:8: note: expanded from macro 'FMT_ASSERT'

      ((condition)                         \

       ^

Unfortunately I cannot find any solid information whether this really is only a clang problem/bug, or something which newer versions/gcc just don't complain about.

We build with --std=c++14. See https://travis-ci.org/github/simulationcraft/simc/jobs/661165928 for the CI build showing the problems.

I was able to reproduce this locally with clang-3.9 and clang-4.0, but not with clang-5.0 or clang-6.0.

@vitaut
Copy link
Contributor

vitaut commented Mar 11, 2020

This was worked around in b2d3a86.

@vitaut vitaut closed this as completed Mar 11, 2020
@scamille
Copy link
Author

Thanks for the quick response.

scamille added a commit to simulationcraft/simc that referenced this issue Mar 11, 2020
This reverts commit 1f56fc3.

Problem is a build problem with clang < 5.0, see fmtlib/fmt#1587

I tried to patch it manually, but am now reverting this until there is a new working release.
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

2 participants