summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbothner <bothner@138bc75d-0d04-0410-961f-82ee72b054a4>2001-08-31 20:07:31 +0000
committerbothner <bothner@138bc75d-0d04-0410-961f-82ee72b054a4>2001-08-31 20:07:31 +0000
commit0997269d4000901fe8ea58b2d0a7f7afd3eb4330 (patch)
tree686b0d25fd6699154b89a2a544beddd51edb2fe2
parent7ad7779822dd67023340856ef5d780b5ba1a0c55 (diff)
downloadppe42-gcc-0997269d4000901fe8ea58b2d0a7f7afd3eb4330.tar.gz
ppe42-gcc-0997269d4000901fe8ea58b2d0a7f7afd3eb4330.zip
* class.c (set_constant_value): When not emiting class files, then a
String ConstantValue is a utf8const_ptr_type. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@45333 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/java/ChangeLog5
-rw-r--r--gcc/java/class.c6
2 files changed, 9 insertions, 2 deletions
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog
index b06dd57aa46..2a89caeefdd 100644
--- a/gcc/java/ChangeLog
+++ b/gcc/java/ChangeLog
@@ -1,3 +1,8 @@
+2001-08-31 Per Bothner <per@bothner.com>
+
+ * class.c (set_constant_value): When not emiting class files, then a
+ String ConstantValue is a utf8const_ptr_type.
+
2001-08-30 Per Bothner <per@bothner.com>
* jcf-write.c (generate_classfile): Check that field is primitive
diff --git a/gcc/java/class.c b/gcc/java/class.c
index 9aa53664028..6086fc0db76 100644
--- a/gcc/java/class.c
+++ b/gcc/java/class.c
@@ -780,8 +780,10 @@ set_constant_value (field, constant)
if (TREE_TYPE (constant) != TREE_TYPE (field)
&& ! (TREE_TYPE (constant) == int_type_node
&& INTEGRAL_TYPE_P (TREE_TYPE (field))
- && TYPE_PRECISION (TREE_TYPE (field)) <= 32))
- warning ("ConstantValue attribute of field '%s' has wrong type",
+ && TYPE_PRECISION (TREE_TYPE (field)) <= 32)
+ && ! (TREE_TYPE (constant) == utf8const_ptr_type
+ && TREE_TYPE (field) == string_ptr_type_node))
+ error ("ConstantValue attribute of field '%s' has wrong type",
IDENTIFIER_POINTER (DECL_NAME (field)));
if (FIELD_FINAL (field))
DECL_FIELD_FINAL_IUD (field) = 1;
OpenPOWER on IntegriCloud