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
0b12f91f
Commit
0b12f91f
authored
Jul 07, 2016
by
Jason Rhinelander
Browse files
Only disable placement-new warning under gcc >= 6
Otherwise this would create unknown option warnings under g++ < 6.
parent
cae0e009
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
include/pybind11/pybind11.h
include/pybind11/pybind11.h
+2
-2
No files found.
include/pybind11/pybind11.h
View file @
0b12f91f
...
@@ -82,12 +82,12 @@ protected:
...
@@ -82,12 +82,12 @@ protected:
/* Store the capture object directly in the function record if there is enough space */
/* Store the capture object directly in the function record if there is enough space */
if
(
sizeof
(
capture
)
<=
sizeof
(
rec
->
data
))
{
if
(
sizeof
(
capture
)
<=
sizeof
(
rec
->
data
))
{
#if defined(__GNUG__) && !defined(__clang__)
#if defined(__GNUG__) && !defined(__clang__)
&& __GNUC__ >= 6
# pragma GCC diagnostic push
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wplacement-new"
# pragma GCC diagnostic ignored "-Wplacement-new"
#endif
#endif
new
((
capture
*
)
&
rec
->
data
)
capture
{
std
::
forward
<
Func
>
(
f
)
};
new
((
capture
*
)
&
rec
->
data
)
capture
{
std
::
forward
<
Func
>
(
f
)
};
#if defined(__GNUG__) && !defined(__clang__)
#if defined(__GNUG__) && !defined(__clang__)
&& __GNUC__ >= 6
# pragma GCC diagnostic pop
# pragma GCC diagnostic pop
#endif
#endif
if
(
!
std
::
is_trivially_destructible
<
Func
>::
value
)
if
(
!
std
::
is_trivially_destructible
<
Func
>::
value
)
...
...
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