Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
json
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
json
Commits
4b0e04eb
Unverified
Commit
4b0e04eb
authored
3 years ago
by
Niels Lohmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix C4100 warnings
parent
288cdf9a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
11 deletions
+5
-11
test/src/unit-allocator.cpp
test/src/unit-allocator.cpp
+1
-4
test/src/unit-udt.cpp
test/src/unit-udt.cpp
+4
-7
No files found.
test/src/unit-allocator.cpp
View file @
4b0e04eb
...
...
@@ -100,9 +100,6 @@ struct my_allocator : std::allocator<T>
std
::
allocator
<
T
>::
deallocate
(
p
,
n
);
}
// the code below warns about p in MSVC 2015 - this could be a bug
DOCTEST_MSVC_SUPPRESS_WARNING_PUSH
DOCTEST_MSVC_SUPPRESS_WARNING
(
4100
)
void
destroy
(
T
*
p
)
{
if
(
next_destroy_fails
)
...
...
@@ -111,9 +108,9 @@ struct my_allocator : std::allocator<T>
throw
std
::
bad_alloc
();
}
static_cast
<
void
>
(
p
);
// fix MSVC's C4100 warning
p
->~
T
();
}
DOCTEST_MSVC_SUPPRESS_WARNING_POP
template
<
class
U
>
struct
rebind
...
...
This diff is collapsed.
Click to expand it.
test/src/unit-udt.cpp
View file @
4b0e04eb
...
...
@@ -809,10 +809,6 @@ TEST_CASE("an incomplete type does not trigger a compiler error in non-evaluated
static_assert
(
!
is_constructible_patched
<
json
,
incomplete
>::
value
,
""
);
}
// the code below warns about t in MSVC 2015 - this could be a bug
DOCTEST_MSVC_SUPPRESS_WARNING_PUSH
DOCTEST_MSVC_SUPPRESS_WARNING
(
4100
)
namespace
{
class
Evil
...
...
@@ -820,13 +816,14 @@ class Evil
public:
Evil
()
=
default
;
template
<
typename
T
>
Evil
(
T
t
)
:
m_i
(
sizeof
(
t
))
{}
Evil
(
T
t
)
:
m_i
(
sizeof
(
t
))
{
static_cast
<
void
>
(
t
);
// fix MSVC's C4100 warning
}
int
m_i
=
0
;
};
DOCTEST_MSVC_SUPPRESS_WARNING_POP
void
from_json
(
const
json
&
/*unused*/
,
Evil
&
/*unused*/
)
{}
}
// namespace
...
...
This diff is collapsed.
Click to expand it.
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