]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/type_traits/test/promote_enum_msvc_bug_test.cpp
1 // Copyright 2009 Alexander Nasonov.
2 // Distributed under the Boost Software License, Version 1.0. (See
3 // accompanying file LICENSE_1_0.txt or copy at
4 // http://www.boost.org/LICENSE_1_0.txt)
6 // Test bug 99776 'enum UIntEnum { value = UINT_MAX } is promoted to int'
7 // http://lab.msdn.microsoft.com/ProductFeedback/viewfeedback.aspx?feedbackid=22b0a6b7-120f-4ca0-9136-fa1b25b26efe
9 // Intel 9.0.028 for Windows has a similar problem:
10 // https://premier.intel.com/IssueDetail.aspx?IssueID=365073
12 #include <boost/type_traits/promote.hpp>
15 #include <boost/static_assert.hpp>
16 #include <boost/type_traits/is_same.hpp>
18 #include "promote_util.hpp"
21 // remark #1418: external function definition with no prior declaration
22 #pragma warning(disable:1418)
25 #if !(defined(BOOST_MSVC) && defined(CI_SUPPRESS_KNOWN_ISSUES))
27 enum UIntEnum
{ UIntEnum_max
= UINT_MAX
};
30 void assert_is_uint(T
)
32 BOOST_STATIC_ASSERT((boost::is_same
<T
, unsigned int>::value
));
35 void test_promote_to_uint()
37 assert_is_uint(+UIntEnum_max
);
38 test_cv
< UIntEnum
, unsigned int >();