aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorPaolo Carlini <paolo.carlini@oracle.com>2012-01-01 22:33:31 +0000
committerPaolo Carlini <paolo@gcc.gnu.org>2012-01-01 22:33:31 +0000
commit11cc5f49ddde6807b157dfaeffc26d286eaf2549 (patch)
tree808f9cfab7d955a51cefa33b0c0ac2bd73f801d4 /gcc/cp
parent9f88ff5a1fedb4ac29628ec421ff0cc613ba6f38 (diff)
downloadgcc-11cc5f49ddde6807b157dfaeffc26d286eaf2549.zip
gcc-11cc5f49ddde6807b157dfaeffc26d286eaf2549.tar.gz
gcc-11cc5f49ddde6807b157dfaeffc26d286eaf2549.tar.bz2
re PR c++/16603 (Incorrect enumerator type before enumeration's closing brace)
/cp 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. /testsuite 2012-01-01 Paolo Carlini <paolo.carlini@oracle.com> PR c++/16603 * g++.dg/parse/enum8.C: New. From-SVN: r182776
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/decl.c11
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;
}
}