summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/cxxformat/runtime.hpp7
-rw-r--r--include/cxxformat/string.hpp3
2 files changed, 8 insertions, 2 deletions
diff --git a/include/cxxformat/runtime.hpp b/include/cxxformat/runtime.hpp
index 3bfe7fe..1c881cc 100644
--- a/include/cxxformat/runtime.hpp
+++ b/include/cxxformat/runtime.hpp
@@ -209,7 +209,12 @@ namespace format {
}
catch(const std::exception& e)
{
- "Formatting error: %s"_format_to(output, e.what());
+ // "Formatting error: %s"_format_to(output, e.what());
+ // workaround for clang bug:
+ // TODO: Remove when fixed
+ const auto out = make_output(output);
+ out("Formatting error: ");
+ out(e.what());
}
}
diff --git a/include/cxxformat/string.hpp b/include/cxxformat/string.hpp
index a40c303..96c9329 100644
--- a/include/cxxformat/string.hpp
+++ b/include/cxxformat/string.hpp
@@ -11,7 +11,8 @@ namespace format {
template<str fmt>
consteval auto operator ""_format() noexcept
{
- return [formatter = parseFormat<fmt, 0, 0, 0>()]<typename... Args>(Args&&... args) -> std::string
+ constexpr auto formatter = parseFormat<fmt, 0, 0, 0>();
+ return [formatter]<typename... Args>(Args&&... args) -> std::string
{
std::ostringstream out;
formatter(out, std::forward<Args>(args)...);