Additional portability fixes (for VC6.0,VC7.0 and Intel C++ 7.0)

[SVN r17082]
This commit is contained in:
Fernando Cacciola
2003-01-29 19:48:43 +00:00
parent 8068c1db25
commit 196b8e7ea0
3 changed files with 86 additions and 33 deletions

View File

@ -17,9 +17,20 @@
//
// THIS TEST SHOULD FAIL TO COMPILE
//
#if BOOST_WORKAROUND( BOOST_INTEL_CXX_VERSION, <= 700) // Intel C++ 7.0
// Interl C++ 7.0 incorrectly accepts the initialization "boost::optional<int> opt = 3"
// even though the ctor is explicit (c.f. 12.3.1.2), so the test uses another form of
// copy-initialization: argument-passing (8.5.12)
void helper ( boost::optional<int> ) ;
void test_explicit_constructor()
{
helper(3) ; // ERROR: Ctor is explicit.
}
#else
void test_explicit_constructor()
{
boost::optional<int> opt = 3 ; // ERROR: Ctor is explicit.
}
#endif