Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
code
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ReadMailReallyFast
code
Commits
9917c0c0
Commit
9917c0c0
authored
2 years ago
by
Benny Baumann
Browse files
Options
Downloads
Patches
Plain Diff
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
!1
First unit tests
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/net/address.hpp
+9
-0
9 additions, 0 deletions
src/net/address.hpp
with
9 additions
and
0 deletions
src/net/address.hpp
+
9
−
0
View file @
9917c0c0
...
@@ -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
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment