Use detect_mismatch pragma when possible (refs #10404 in track)

This commit is contained in:
Antony Polukhin committed 2014-08-26 14:41:54 +04:00
1 parent 99f58714d1
commit 242d9a0bed
6 files changed
+23 -4

No files matched your search

+2 -2
View File
@@ -51,8 +51,8 @@ test-suite type_index
# Mixing RTTI on and off
[ link-fail testing_crossmodule.cpp test_lib_rtti : $(nortti) : link_fail_nortti_rtti ]
# MSVC sometimes overrides the /GR-, that's why the following tests is disabled
#[ link-fail testing_crossmodule.cpp test_lib_nortti : : link_fail_rtti_nortti ]
# MSVC sometimes overrides the /GR-, without `detect_missmatch` this test may link
[ link-fail testing_crossmodule.cpp test_lib_nortti : : link_fail_rtti_nortti ]
[ run testing_crossmodule.cpp test_lib_rtti_compat : : : $(nortti) $(compat) : testing_crossmodule_nortti_rtti_compat ]
[ run testing_crossmodule.cpp test_lib_nortti_compat : : : $(compat) : testing_crossmodule_rtti_nortti_compat ]
;
+2 -1
View File
@@ -31,9 +31,10 @@ boost::typeindex::type_index get_const_user_defined_class() {
return boost::typeindex::type_id_with_cvr<const user_defined_namespace::user_defined>();
}
#ifndef BOOST_HAS_PRAGMA_DETECT_MISMATCH
// Just do nothing
void accept_typeindex(const boost::typeindex::type_index&) {}
#endif
}
+2
View File
@@ -31,8 +31,10 @@ TEST_LIB_DECL boost::typeindex::type_index get_user_defined_class();
TEST_LIB_DECL boost::typeindex::type_index get_const_integer();
TEST_LIB_DECL boost::typeindex::type_index get_const_user_defined_class();
#ifndef BOOST_HAS_PRAGMA_DETECT_MISMATCH
// This is required for checking RTTI on/off linkage
TEST_LIB_DECL void accept_typeindex(const boost::typeindex::type_index&);
#endif
}
+3 -1
View File
@@ -44,7 +44,9 @@ void comparing_types_between_modules()
BOOST_CHECK_NE(t_int, test_lib::get_user_defined_class());
BOOST_CHECK_NE(t_const_int, test_lib::get_const_user_defined_class());
test_lib::accept_typeindex(t_int);
#ifndef BOOST_HAS_PRAGMA_DETECT_MISMATCH
test_lib::accept_typeindex(t_int);
#endif
}