Skip to content
Snippets Groups Projects
Commit 9917c0c0 authored by Benny Baumann's avatar Benny Baumann
Browse files

fix: Do not bail on GCC string literal extension

Unfortunately this is not pure C++20 :(
parent ffa09515
No related branches found
No related tags found
1 merge request!1First unit tests
...@@ -481,6 +481,13 @@ static constexpr bool is_valid_ip6addr(const char (&str)[N]) ...@@ -481,6 +481,13 @@ static constexpr bool is_valid_ip6addr(const char (&str)[N])
} }
// Work around use of non-standard feature (not part of ISO-C++)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wpedantic"
#ifdef __clang__
#pragma GCC diagnostic ignored "-Wgnu-string-literal-operator-template"
#endif
template <typename CharT, CharT... Cs> template <typename CharT, CharT... Cs>
static constexpr auto operator"" _ipaddr() static constexpr auto operator"" _ipaddr()
{ {
...@@ -513,6 +520,8 @@ static constexpr auto operator"" _ip6() ...@@ -513,6 +520,8 @@ static constexpr auto operator"" _ip6()
return rmrf::net::inet_pton<AF_INET6>(str); return rmrf::net::inet_pton<AF_INET6>(str);
} }
#pragma GCC diagnostic pop
static constexpr uint16_t operator "" _ipport(unsigned long long port) static constexpr uint16_t operator "" _ipport(unsigned long long port)
{ {
if (port > 65535) { if (port > 65535) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment