-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Consteval error on C++20 #2438
Labels
Comments
You can wrap the format string in std::string functionTest(std::string_view content, const std::string& value) {
return fmt::format(fmt::runtime(content), value);
} or pass it as |
Thanks for your attention! @vitaut :) |
facebook-github-bot
pushed a commit
to facebook/sapling
that referenced
this issue
Apr 21, 2022
Summary: When we try to switch to platform 10 we get this compile error: ``` eden/fs/nfs/Nfsd3.cpp:1378:26: error: call to consteval function 'fmt::basic_format_string<char, const unsigned int &>::basic_format_string<const char *, 0>' is not a constant expression return fmt::format(fmtString, std::get<typename T::TrueVariant>(val.v)); ``` The problem is that fmtString either needs to be a `basic_format_string` or needs to be a constexpr so that we can cast it to `basic_format_string` through various means. Not totally sure why this worked pre c++ 20, but C++20 introduced some stricter type checking on the fmt library or constexpr stuff in general i guess. fmtlib/fmt#2438 outlines the possible fixes `fmt::runtime` looks like the best way. Reviewed By: vitaut Differential Revision: D35756658 fbshipit-source-id: 7b65ccf0719a964ab1f2fc1aed72744e72374d20
Toni500github
added a commit
to BurntRanch/TabAUR
that referenced
this issue
Apr 22, 2024
And so bring the C++20 designated-initializers. it was fault of log_print{f,ln} all-along fixed thanks to fmtlib/fmt#2438
nevack
added a commit
to nevack/transmission
that referenced
this issue
May 7, 2024
fmt::format_string ctor is consteval with C++20 See fmtlib/fmt#2438 Signed-off-by: Dzmitry Neviadomski <[email protected]>
nevack
added a commit
to nevack/transmission
that referenced
this issue
May 22, 2024
fmt::format_string ctor is consteval with C++20 See fmtlib/fmt#2438 Signed-off-by: Dzmitry Neviadomski <[email protected]>
nevack
added a commit
to nevack/transmission
that referenced
this issue
May 22, 2024
fmt::format_string ctor is consteval with C++20 See fmtlib/fmt#2438 Signed-off-by: Dzmitry Neviadomski <[email protected]>
nevack
added a commit
to nevack/transmission
that referenced
this issue
May 22, 2024
fmt::format_string ctor is consteval with C++20 See fmtlib/fmt#2438 Signed-off-by: Dzmitry Neviadomski <[email protected]>
nevack
added a commit
to nevack/transmission
that referenced
this issue
May 22, 2024
fmt::format_string ctor is consteval with C++20 See fmtlib/fmt#2438 Signed-off-by: Dzmitry Neviadomski <[email protected]>
nevack
added a commit
to nevack/transmission
that referenced
this issue
Jun 28, 2024
fmt::format_string ctor is consteval with C++20 See fmtlib/fmt#2438 Signed-off-by: Dzmitry Neviadomski <[email protected]>
nevack
added a commit
to nevack/transmission
that referenced
this issue
Jun 29, 2024
… and cli fmt::format_string ctor is consteval with C++20 See fmtlib/fmt#2438 Signed-off-by: Dzmitry Neviadomski <[email protected]>
nevack
added a commit
to nevack/transmission
that referenced
this issue
Jun 29, 2024
… and cli fmt::format_string ctor is consteval with C++20 See fmtlib/fmt#2438 Signed-off-by: Dzmitry Neviadomski <[email protected]>
4 tasks
nevack
added a commit
to nevack/transmission
that referenced
this issue
Oct 29, 2024
… and cli fmt::format_string ctor is consteval with C++20 See fmtlib/fmt#2438 Signed-off-by: Dzmitry Neviadomski <[email protected]>
nevack
added a commit
to nevack/transmission
that referenced
this issue
Dec 29, 2024
… and cli fmt::format_string ctor is consteval with C++20 See fmtlib/fmt#2438 Signed-off-by: Dzmitry Neviadomski <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
As you know we can't use constexpr variables in function parameter.
But I need use function parameters from other json files.
Example :
How can I solve this problem?
Error:
The text was updated successfully, but these errors were encountered: