From 2561fd182d92d53855dbcd85c9224cd07fbd0873 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20W=C3=BCrtz?= Date: Thu, 26 Mar 2020 09:42:58 +0100 Subject: [PATCH] Fix for u8 char C++20 incompatibility C++20 apparently doesn't allow std::string construction from u8 literals any more. The pre-20 behavior is restored by explicitly casting the new `char_8_t` back to `char`. --- peglib.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/peglib.h b/peglib.h index 739eac9..4b08916 100644 --- a/peglib.h +++ b/peglib.h @@ -3035,7 +3035,7 @@ private: cls("0-9a-fA-F"), cls("0-9a-fA-F")), seq(npd(chr('\\')), dot())); - g["LEFTARROW"] <= seq(cho(lit("<-"), lit(u8"←")), g["Spacing"]); + g["LEFTARROW"] <= seq(cho(lit("<-"), lit(reinterpret_cast(u8"←"))), g["Spacing"]); ~g["SLASH"] <= seq(chr('/'), g["Spacing"]); ~g["PIPE"] <= seq(chr('|'), g["Spacing"]); g["AND"] <= seq(chr('&'), g["Spacing"]);