From 68a4a628cfc8ebf11e4ec4b3a18fa9d4ccf4f548 Mon Sep 17 00:00:00 2001 From: Alexander Nasonov Date: Sat, 23 May 2009 22:32:10 +0000 Subject: [PATCH] Test for: enum UIntEnum { value = UINT_MAX } is promoted to int [SVN r53220] --- test/promote_enum_msvc_bug_test.cpp | 39 +++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 test/promote_enum_msvc_bug_test.cpp diff --git a/test/promote_enum_msvc_bug_test.cpp b/test/promote_enum_msvc_bug_test.cpp new file mode 100644 index 0000000..4d34bc0 --- /dev/null +++ b/test/promote_enum_msvc_bug_test.cpp @@ -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 + +#include +#include +#include + +#include "promote_util.hpp" + + +enum UIntEnum { UIntEnum_max = UINT_MAX }; + +template +void assert_is_uint(T) +{ + BOOST_STATIC_ASSERT((boost::is_same::value)); +} + +void test_promote_to_uint() +{ + assert_is_uint(+UIntEnum_max); + test_cv< UIntEnum, unsigned int >(); +} + +int main() +{ + return 0; +} +