c-decl.c (build_enumerator): Don't modify the value's type, convert it.
authorAlexandre Oliva <aoliva@cygnus.com>
Wed, 24 May 2000 09:08:42 +0000 (09:08 +0000)
committerAlexandre Oliva <aoliva@gcc.gnu.org>
Wed, 24 May 2000 09:08:42 +0000 (09:08 +0000)
* c-decl.c (build_enumerator): Don't modify the value's type,
convert it.

From-SVN: r34131

gcc/ChangeLog
gcc/c-decl.c

index 7d37b3a748d4e9b86a7f5330f06bfb56faeca87a..b874d9ff920784aa3dacbb1d9bc57d309180866a 100644 (file)
@@ -1,3 +1,8 @@
+2000-05-24  Alexandre Oliva  <aoliva@cygnus.com>
+
+       * c-decl.c (build_enumerator): Don't modify the value's type,
+       convert it.
+
 2000-05-24  Andreas Jaeger  <aj@suse.de>
 
        * mips.h (LINKER_ENDIAN_SPEC): Pass -EL to linker by default.
index 20c60895c1844b58bf7886211ba8ff135e19bf7f..34fca5d8812d2eee92b180603a81e56f82c3d9ca 100644 (file)
@@ -5666,8 +5666,7 @@ build_enumerator (name, value)
                         && TREE_UNSIGNED (type)));
 
   decl = build_decl (CONST_DECL, name, type);
-  DECL_INITIAL (decl) = value;
-  TREE_TYPE (value) = type;
+  DECL_INITIAL (decl) = convert (type, value);
   pushdecl (decl);
 
   return tree_cons (decl, value, NULL_TREE);