From b78772c2ab873657f7aaf706b7c7bd48c959f2ec Mon Sep 17 00:00:00 2001 From: Leander Schulten Date: Sun, 17 May 2026 20:18:16 +0200 Subject: [PATCH] parser.hpp: make compatible with modules `parse_bool` is referenced from `env::variable_id` via some other types. If I now have ```c++ module; #include export module testModule; export { template struct EnvironmentVariableBase { env::variable_id m_id; } } ``` I export a type that references a TU local definition in its template instantiation, which is invalid c++ and causes gcc to crash (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125356). inline is enough here and also prevents binary bloat since only one definition is created for every TU that includes `env.hpp`. --- include/libenvpp/detail/parser.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/libenvpp/detail/parser.hpp b/include/libenvpp/detail/parser.hpp index ad3784c..6fcc352 100644 --- a/include/libenvpp/detail/parser.hpp +++ b/include/libenvpp/detail/parser.hpp @@ -55,7 +55,7 @@ inline constexpr auto is_stringstream_constructible_v = is_stringstream_construc ////////////////////////////////////////////////////////////////////////// -[[nodiscard]] static inline bool parse_bool(const std::string_view str) +[[nodiscard]] inline bool parse_bool(const std::string_view str) { constexpr auto to_lower_char = [](const char c) -> char { if ('A' <= c && c <= 'Z') {