diff options
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/decl.c | 11 |
2 files changed, 10 insertions, 7 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index b4a3df4..c602721 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,11 @@ 2012-01-01 Paolo Carlini <paolo.carlini@oracle.com> + PR c++/16603 + * decl.c (build_enumerator): Don't call perform_integral_promotions + on the value. + +2012-01-01 Paolo Carlini <paolo.carlini@oracle.com> + PR c++/51379 * typeck.c (build_reinterpret_cast_1): Implement resolution of DR 799. diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 2fc794b..48f3085 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -12369,14 +12369,11 @@ build_enumerator (tree name, tree value, tree enumtype, location_t loc) { value = cxx_constant_value (value); - if (TREE_CODE (value) == INTEGER_CST - && INTEGRAL_OR_ENUMERATION_TYPE_P (TREE_TYPE (value))) + if (TREE_CODE (value) != INTEGER_CST + || ! INTEGRAL_OR_ENUMERATION_TYPE_P (TREE_TYPE (value))) { - value = perform_integral_promotions (value); - } - else - { - error ("enumerator value for %qD is not an integer constant", name); + error ("enumerator value for %qD is not an integer constant", + name); value = NULL_TREE; } } |