From 432d4782a5e7af5ce1a7ef7fa9060cbe86fbda3e Mon Sep 17 00:00:00 2001 From: Dave Abrahams Date: Wed, 18 May 2005 01:34:35 +0000 Subject: [PATCH] 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] --- include/boost/python/converter/registered.hpp | 2 +- src/converter/builtin_converters.cpp | 11 +++++++++-- test/module_tail.cpp | 1 + test/opaque.cpp | 8 -------- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/include/boost/python/converter/registered.hpp b/include/boost/python/converter/registered.hpp index 4b3866f1..28413c83 100644 --- a/include/boost/python/converter/registered.hpp +++ b/include/boost/python/converter/registered.hpp @@ -81,7 +81,7 @@ namespace detail registry_lookup(T&(*)()) { detail::register_shared_ptr1((T*)0); - return registry::lookup(type_id()); + return registry::lookup(type_id()); } template diff --git a/src/converter/builtin_converters.cpp b/src/converter/builtin_converters.cpp index 50df682e..c755f617 100644 --- a/src/converter/builtin_converters.cpp +++ b/src/converter/builtin_converters.cpp @@ -74,8 +74,15 @@ namespace // Get the location in which to construct void* storage = ((rvalue_from_python_storage*)data)->storage.bytes; - new (storage) T(SlotPolicy::extract(intermediate.get())); - +# ifdef _MSC_VER +# pragma warning(push) +# pragma warning(disable:4244) +# endif + new (storage) T( SlotPolicy::extract(intermediate.get()) ); + +# ifdef _MSC_VER +# pragma warning(pop) +# endif // record successful construction data->convertible = storage; } diff --git a/test/module_tail.cpp b/test/module_tail.cpp index e837e29d..48a9c67b 100644 --- a/test/module_tail.cpp +++ b/test/module_tail.cpp @@ -15,6 +15,7 @@ # ifdef _MSC_VER # pragma warning(push) # pragma warning(disable:4297) +# pragma warning(disable:4535) extern "C" void straight_to_debugger(unsigned int, EXCEPTION_POINTERS*) { throw; diff --git a/test/opaque.cpp b/test/opaque.cpp index a6f7dd2e..f15e9458 100644 --- a/test/opaque.cpp +++ b/test/opaque.cpp @@ -7,16 +7,8 @@ # include # include -# if BOOST_WORKAROUND(__GNUC__, == 2) \ - || BOOST_WORKAROUND(__GNUC__, BOOST_TESTED_AT(3)) \ - && BOOST_WORKAROUND(__GNUC_MINOR__, BOOST_TESTED_AT(3)) \ - && BOOST_WORKAROUND(__GNUC_PATCHLEVEL__, BOOST_TESTED_AT(3)) -typedef struct opaque_ {} *opaque; -typedef struct opaque2_ {} *opaque2; -# else typedef struct opaque_ *opaque; typedef struct opaque2_ *opaque2; -# endif opaque the_op = ((opaque) 0x47110815); opaque2 the_op2 = ((opaque2) 0x08154711);