aboutsummaryrefslogtreecommitdiff
path: root/gcc/java/class.c
diff options
context:
space:
mode:
authorPer Bothner <per@bothner.com>2001-08-31 13:07:31 -0700
committerPer Bothner <bothner@gcc.gnu.org>2001-08-31 13:07:31 -0700
commit289b57ee28d0deca5af21333eca23557245a7f08 (patch)
tree686b0d25fd6699154b89a2a544beddd51edb2fe2 /gcc/java/class.c
parent6268b92246a83813217648665eaf168eb02e19ba (diff)
downloadgcc-289b57ee28d0deca5af21333eca23557245a7f08.zip
gcc-289b57ee28d0deca5af21333eca23557245a7f08.tar.gz
gcc-289b57ee28d0deca5af21333eca23557245a7f08.tar.bz2
class.c (set_constant_value): When not emiting class files, then a String ConstantValue is a utf8const_ptr_type.
* class.c (set_constant_value): When not emiting class files, then a String ConstantValue is a utf8const_ptr_type. From-SVN: r45333
Diffstat (limited to 'gcc/java/class.c')
-rw-r--r--gcc/java/class.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/java/class.c b/gcc/java/class.c
index 9aa5366..6086fc0 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;