Opened 14 years ago

#2515 new Bugs

[MSVC] ambiguous symbol type_info in boost/python tests

Reported by: Farid Zaripov <faridz@…> Owned by: Dave Abrahams
Milestone: Boost 1.38.0 Component: python USE GITHUB
Version: Boost Development Trunk Severity: Problem
Keywords: Cc: David Abrahams <dave@…>

Description

The most of the boost/python tests are failed to compile on MSVC with Apache stdcxx library.

example 1 example 2

The reason is that <eh.h> header contains declaration of the:

int _is_exception_typeof(const type_info &, _EXCEPTION_POINTERS *) ;

<eh.h> header is included in libs/python/test/module_tail.cpp file. The module_tail.cpp is included in other pythons tests at the end of file after introducing boost::python symbols in global namespace.

That tests are compiled successfully on MSVC without stdcxx due to <eh.h> implicitly included thus <exception> header (before "using namespace boost::python;" directive). But any of the stdcxx headers are not including the <eh.h> (see ticket 1599).

The possible solution is explicitly include <eh.h> in every test, that includes module_tail.cpp.

Another solution:

Index: module_tail.cpp
===================================================================
--- module_tail.cpp	(revision 49830)
+++ module_tail.cpp	(working copy)
@@ -13,7 +13,9 @@
 # endif
 
 # ifdef _MSC_VER
+#  define type_info ::type_info
 #  include <eh.h> // for _set_se_translator()
+#  undef type_info
 #  pragma warning(push)
 #  pragma warning(disable:4297)
 #  pragma warning(disable:4535)

Change History (0)

Note: See TracTickets for help on using tickets.