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

🐛 Cannot call non-constexpr function in constexpr context #2010

Merged
merged 1 commit into from
Nov 12, 2020

Commits on Nov 12, 2020

  1. 🐛 Cannot call non-constexpr function in constexpr context

    Problem:
    - gcc-8 gives the following error when compiling this function on all
      standards:
        test/std-format-test.cc: In member function 'constexpr auto std::formatter<S>::parse(std::format_parse_context&)':
        test/std-format-test.cc:112:17: error: call to non-'constexpr' function 'int isdigit(int)'
            if (!isdigit(c) || (++iter, get_char()) != '}')
             ~~~~~~~^~~
    
    Solution:
    - Write a `constexpr` version of `isdigit` for use in this function.
    Jonathan Gopel committed Nov 12, 2020
    Configuration menu
    Copy the full SHA
    3516355 View commit details
    Browse the repository at this point in the history