Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
F
fmt
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
fmt
Commits
99b6e928
Commit
99b6e928
authored
Nov 25, 2019
by
Victor Zverovich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix handling of types with deleted rvalue conversion to string (#1421)
parent
57cd3f72
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
1 deletion
+12
-1
include/fmt/core.h
include/fmt/core.h
+1
-1
test/core-test.cc
test/core-test.cc
+11
-0
No files found.
include/fmt/core.h
View file @
99b6e928
...
@@ -923,7 +923,7 @@ template <typename Context> struct arg_mapper {
...
@@ -923,7 +923,7 @@ template <typename Context> struct arg_mapper {
// A type constant after applying arg_mapper<Context>.
// A type constant after applying arg_mapper<Context>.
template
<
typename
T
,
typename
Context
>
template
<
typename
T
,
typename
Context
>
using
mapped_type_constant
=
using
mapped_type_constant
=
type_constant
<
decltype
(
arg_mapper
<
Context
>
().
map
(
std
::
declval
<
T
>
())),
type_constant
<
decltype
(
arg_mapper
<
Context
>
().
map
(
std
::
declval
<
const
T
&
>
())),
typename
Context
::
char_type
>
;
typename
Context
::
char_type
>
;
enum
{
packed_arg_bits
=
5
};
enum
{
packed_arg_bits
=
5
};
...
...
test/core-test.cc
View file @
99b6e928
...
@@ -649,3 +649,14 @@ TEST(FormatterTest, FormatExplicitlyConvertibleToStringLike) {
...
@@ -649,3 +649,14 @@ TEST(FormatterTest, FormatExplicitlyConvertibleToStringLike) {
EXPECT_EQ
(
"foo"
,
fmt
::
format
(
"{}"
,
explicitly_convertible_to_string_like
()));
EXPECT_EQ
(
"foo"
,
fmt
::
format
(
"{}"
,
explicitly_convertible_to_string_like
()));
}
}
#endif
#endif
struct
disabled_rvalue_conversion
{
operator
const
char
*
()
const
&
{
return
"foo"
;
}
operator
const
char
*
()
&
{
return
"foo"
;
}
operator
const
char
*
()
const
&&
=
delete
;
operator
const
char
*
()
&&
=
delete
;
};
TEST
(
FormatterTest
,
DisabledRValueConversion
)
{
EXPECT_EQ
(
"foo"
,
fmt
::
format
(
"{}"
,
disabled_rvalue_conversion
()));
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment