/*-----------------------------------------------------------------------------+ Copyright (c) 2011-2011: Joachim Faulhaber +------------------------------------------------------------------------------+ Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENCE.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +-----------------------------------------------------------------------------*/ #define BOOST_TEST_MODULE icl::cmp_msvc_value_born_error unit test #include #include "../unit_test_unwarned.hpp" namespace unhelpful{ // This declaration of a class template will cause // the compilation of line 17 to fail with syntax error C2059 template class value{}; } //--- affected code --------------------------------------- template struct meta_attribute { BOOST_STATIC_CONSTANT(int, value = 0); }; template struct meta_predicate { BOOST_STATIC_CONSTANT(bool, value = ( meta_attribute::value < 1) //error C2059: syntax error : ')' //IF class template value declared before // ((meta_attribute::value) < 1) // Remedy#1 enclose into () // ( meta_attribute::value <=0) // Remedy#2 use operator <= ); }; BOOST_AUTO_TEST_CASE(dummy) { BOOST_CHECK( meta_predicate::value ); }