mirror of
https://github.com/boostorg/typeof.git
synced 2025-07-31 21:34:42 +02:00
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:
@@ -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
|
||||
|
@@ -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
|
||||
}
|
||||
|
@@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user