Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gaoqiong
pybind11
Commits
c2ee3f52
Commit
c2ee3f52
authored
Jul 07, 2016
by
Wenzel Jakob
Committed by
GitHub
Jul 07, 2016
Browse files
Merge pull request #272 from jagerman/fix-gcc6-placement-new-warning
Fix gcc6 placement new warning
parents
4be37c17
0b12f91f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
0 deletions
+7
-0
include/pybind11/pybind11.h
include/pybind11/pybind11.h
+7
-0
No files found.
include/pybind11/pybind11.h
View file @
c2ee3f52
...
...
@@ -82,7 +82,14 @@ protected:
/* Store the capture object directly in the function record if there is enough space */
if
(
sizeof
(
capture
)
<=
sizeof
(
rec
->
data
))
{
#if defined(__GNUG__) && !defined(__clang__) && __GNUC__ >= 6
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wplacement-new"
#endif
new
((
capture
*
)
&
rec
->
data
)
capture
{
std
::
forward
<
Func
>
(
f
)
};
#if defined(__GNUG__) && !defined(__clang__) && __GNUC__ >= 6
# pragma GCC diagnostic pop
#endif
if
(
!
std
::
is_trivially_destructible
<
Func
>::
value
)
rec
->
free_data
=
[](
detail
::
function_record
*
r
)
{
((
capture
*
)
&
r
->
data
)
->~
capture
();
};
}
else
{
...
...
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