Skip to content

Commit 432d478

Browse files
committed
Take typeid(T&) rather than typeid(T). For some some compilers won't
let you get away with typeid(T) when T is an incomplete class type (that's conforming behavior), but GCC at least will allow typeid(T&) -- also disallowed by the standard when T is incomplete. If it turns out that EDGs also barf on typeid(T&), we may have more work to do. Some warning suppression for MSVC. [SVN r29020]
1 parent 424f5bd commit 432d478

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

include/boost/python/converter/registered.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ namespace detail
8181
registry_lookup(T&(*)())
8282
{
8383
detail::register_shared_ptr1((T*)0);
84-
return registry::lookup(type_id<T>());
84+
return registry::lookup(type_id<T&>());
8585
}
8686

8787
template <class T>

src/converter/builtin_converters.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,15 @@ namespace
7474

7575
// Get the location in which to construct
7676
void* storage = ((rvalue_from_python_storage<T>*)data)->storage.bytes;
77-
new (storage) T(SlotPolicy::extract(intermediate.get()));
78-
77+
# ifdef _MSC_VER
78+
# pragma warning(push)
79+
# pragma warning(disable:4244)
80+
# endif
81+
new (storage) T( SlotPolicy::extract(intermediate.get()) );
82+
83+
# ifdef _MSC_VER
84+
# pragma warning(pop)
85+
# endif
7986
// record successful construction
8087
data->convertible = storage;
8188
}

test/module_tail.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
# ifdef _MSC_VER
1616
# pragma warning(push)
1717
# pragma warning(disable:4297)
18+
# pragma warning(disable:4535)
1819
extern "C" void straight_to_debugger(unsigned int, EXCEPTION_POINTERS*)
1920
{
2021
throw;

test/opaque.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,8 @@
77
# include <boost/python/module.hpp>
88
# include <boost/python/return_value_policy.hpp>
99

10-
# if BOOST_WORKAROUND(__GNUC__, == 2) \
11-
|| BOOST_WORKAROUND(__GNUC__, BOOST_TESTED_AT(3)) \
12-
&& BOOST_WORKAROUND(__GNUC_MINOR__, BOOST_TESTED_AT(3)) \
13-
&& BOOST_WORKAROUND(__GNUC_PATCHLEVEL__, BOOST_TESTED_AT(3))
14-
typedef struct opaque_ {} *opaque;
15-
typedef struct opaque2_ {} *opaque2;
16-
# else
1710
typedef struct opaque_ *opaque;
1811
typedef struct opaque2_ *opaque2;
19-
# endif
2012

2113
opaque the_op = ((opaque) 0x47110815);
2214
opaque2 the_op2 = ((opaque2) 0x08154711);

0 commit comments

Comments
 (0)