Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r53220 - trunk/libs/type_traits/test
From: Alexander.Nasonov_at_[hidden]
Date: 2009-05-23 18:32:11


Author: nasonov
Date: 2009-05-23 18:32:10 EDT (Sat, 23 May 2009)
New Revision: 53220
URL: http://svn.boost.org/trac/boost/changeset/53220

Log:
Test for: enum UIntEnum { value = UINT_MAX } is promoted to int
Added:
   trunk/libs/type_traits/test/promote_enum_msvc_bug_test.cpp (contents, props changed)

Added: trunk/libs/type_traits/test/promote_enum_msvc_bug_test.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/type_traits/test/promote_enum_msvc_bug_test.cpp 2009-05-23 18:32:10 EDT (Sat, 23 May 2009)
@@ -0,0 +1,39 @@
+// Copyright 2009 Alexander Nasonov.
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// Test bug 99776 'enum UIntEnum { value = UINT_MAX } is promoted to int'
+// http://lab.msdn.microsoft.com/ProductFeedback/viewfeedback.aspx?feedbackid=22b0a6b7-120f-4ca0-9136-fa1b25b26efe
+//
+// Intel 9.0.028 for Windows has a similar problem:
+// https://premier.intel.com/IssueDetail.aspx?IssueID=365073
+
+#include <boost/type_traits/promote.hpp>
+
+#include <climits>
+#include <boost/static_assert.hpp>
+#include <boost/type_traits/is_same.hpp>
+
+#include "promote_util.hpp"
+
+
+enum UIntEnum { UIntEnum_max = UINT_MAX };
+
+template<class T>
+void assert_is_uint(T)
+{
+ BOOST_STATIC_ASSERT((boost::is_same<T, unsigned int>::value));
+}
+
+void test_promote_to_uint()
+{
+ assert_is_uint(+UIntEnum_max);
+ test_cv< UIntEnum, unsigned int >();
+}
+
+int main()
+{
+ return 0;
+}
+


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk