aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2011-02-10 11:30:08 -0500
committerJason Merrill <jason@gcc.gnu.org>2011-02-10 11:30:08 -0500
commitc51dc544b1c7f64888f9c3023700a5793e427aba (patch)
tree8a08fe54bb8ae6f3014108c6fcd1a0db20193062 /gcc/cp
parentcb8384a3f592146069847a1f608a4b17fe0dfada (diff)
downloadgcc-c51dc544b1c7f64888f9c3023700a5793e427aba.zip
gcc-c51dc544b1c7f64888f9c3023700a5793e427aba.tar.gz
gcc-c51dc544b1c7f64888f9c3023700a5793e427aba.tar.bz2
decl.c (build_enumerator): Don't perform integral promotions on non-integral constants.
* decl.c (build_enumerator): Don't perform integral promotions on non-integral constants. From-SVN: r170008
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog3
-rw-r--r--gcc/cp/decl.c3
2 files changed, 5 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 7d9667d..20b0d4b 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,5 +1,8 @@
2011-02-09 Jason Merrill <jason@redhat.com>
+ * decl.c (build_enumerator): Don't perform integral promotions on
+ non-integral constants.
+
* cvt.c (convert_to_void): Handle null op1.
* class.c (type_has_constexpr_default_constructor): Make sure the
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 6a13cc4..866069d 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -11869,7 +11869,8 @@ build_enumerator (tree name, tree value, tree enumtype, location_t loc)
{
value = cxx_constant_value (value);
- if (TREE_CODE (value) == INTEGER_CST)
+ if (TREE_CODE (value) == INTEGER_CST
+ && INTEGRAL_OR_ENUMERATION_TYPE_P (TREE_TYPE (value)))
{
value = perform_integral_promotions (value);
}