]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/type_traits/test/promote_enum_msvc_bug_test.cpp
update sources to v12.2.3
[ceph.git] / 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)
5
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
8 //
9 // Intel 9.0.028 for Windows has a similar problem:
10 // https://premier.intel.com/IssueDetail.aspx?IssueID=365073
11
12 #include <boost/type_traits/promote.hpp>
13
14 #include <climits>
15 #include <boost/static_assert.hpp>
16 #include <boost/type_traits/is_same.hpp>
17
18 #include "promote_util.hpp"
19
20 #ifdef BOOST_INTEL
21 // remark #1418: external function definition with no prior declaration
22 #pragma warning(disable:1418)
23 #endif
24
25 #if !(defined(BOOST_MSVC) && defined(CI_SUPPRESS_KNOWN_ISSUES))
26
27 enum UIntEnum { UIntEnum_max = UINT_MAX };
28
29 template<class T>
30 void assert_is_uint(T)
31 {
32 BOOST_STATIC_ASSERT((boost::is_same<T, unsigned int>::value));
33 }
34
35 void test_promote_to_uint()
36 {
37 assert_is_uint(+UIntEnum_max);
38 test_cv< UIntEnum, unsigned int >();
39 }
40
41 #endif
42
43 int main()
44 {
45 return 0;
46 }
47