diff --git a/test/vintage/odr.hpp b/test/vintage/odr.hpp index 6e163dc..030b48f 100644 --- a/test/vintage/odr.hpp +++ b/test/vintage/odr.hpp @@ -10,12 +10,15 @@ void odr_test1(); void odr_test2(); +#if! BOOST_WORKAROUND(BOOST_MSVC,==1300) + // trying to cause ODR violation in a class template template class sum_t { public: +// VC7 fails using template types in typeof expression. typedef BOOST_TYPEOF_TPL(T() + U()) result_type; sum_t(const T& t, const U& u); @@ -50,5 +53,6 @@ typename sum_t::result_type sum(const T& t, const U& u) BOOST_AUTO_TPL(result, t + u); return result; } +#endif #endif//ODR_HPP_INCLUDED diff --git a/test/vintage/odr1.cpp b/test/vintage/odr1.cpp index 82eece3..e4b030d 100644 --- a/test/vintage/odr1.cpp +++ b/test/vintage/odr1.cpp @@ -9,10 +9,12 @@ using namespace std; void odr_test1() { +#if! BOOST_WORKAROUND(BOOST_MSVC,==1300) char i = 5; double d = 3.14; cout << sum(d, i) << endl; cout << sum(i, d) << endl; cout << make_sum(d, i)() << endl; cout << make_sum(i, d)() << endl; +#endif } diff --git a/test/vintage/odr2.cpp b/test/vintage/odr2.cpp index 31b4bdd..783a157 100644 --- a/test/vintage/odr2.cpp +++ b/test/vintage/odr2.cpp @@ -9,10 +9,12 @@ using namespace std; void odr_test2() { +#if! BOOST_WORKAROUND(BOOST_MSVC,==1300) char i = 5; double d = 3.14; cout << sum(d, i) << endl; cout << sum(i, d) << endl; cout << make_sum(d, i)() << endl; cout << make_sum(i, d)() << endl; +#endif }