aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/parser.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp/parser.c')
-rw-r--r--gcc/cp/parser.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index 11039b8..8f4a121 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -13763,6 +13763,10 @@ cp_parser_enumerator_definition (cp_parser* parser, tree type)
if (check_for_bare_parameter_packs (value))
value = error_mark_node;
+ /* integral_constant_value will pull out this expression, so make sure
+ it's folded as appropriate. */
+ value = fold_non_dependent_expr (value);
+
/* Create the enumerator. */
build_enumerator (identifier, value, type, loc);
}