Disable odr tests for VC7. This compiler does not handle template types in expressions (at least not inside BOOST_TYPEOF)

[SVN r2442]
This commit is contained in:
Peder Holt
2005-01-11 21:30:34 +00:00
parent 99bd35b735
commit a330151f32
3 changed files with 8 additions and 0 deletions

View File

@@ -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 T, class U>
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<T, U>::result_type sum(const T& t, const U& u)
BOOST_AUTO_TPL(result, t + u);
return result;
}
#endif
#endif//ODR_HPP_INCLUDED

View File

@@ -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
}

View File

@@ -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
}