summaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2011-02-10 16:30:08 +0000
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2011-02-10 16:30:08 +0000
commit3d40bfb8a4365617317344f586b7c1a6e6b6e2c1 (patch)
tree8a08fe54bb8ae6f3014108c6fcd1a0db20193062 /gcc/cp
parent527facbb29c4923eca0e23e10a774beb16525d32 (diff)
downloadgcc-3d40bfb8a4365617317344f586b7c1a6e6b6e2c1.tar.gz
* decl.c (build_enumerator): Don't perform integral promotions on
non-integral constants. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@170008 138bc75d-0d04-0410-961f-82ee72b054a4
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 7d9667d4392..20b0d4be65f 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 6a13cc474ae..866069dd3e7 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);
}