diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2009-10-21 10:20:06 +0000 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2009-10-21 10:20:06 +0000 |
commit | 3c28a5f48c173ca546369b2434c0701009320569 (patch) | |
tree | 6335004f876cd0c17ec3b49656a9db78f4e4860f /gcc/ada/gcc-interface/decl.c | |
parent | 9a1c0fd9f2a59bbbfb4801064bf7cad898389e70 (diff) | |
download | gcc-3c28a5f48c173ca546369b2434c0701009320569.zip gcc-3c28a5f48c173ca546369b2434c0701009320569.tar.gz gcc-3c28a5f48c173ca546369b2434c0701009320569.tar.bz2 |
decl.c (build_subst_list): Convert the expression of the constraint to the type of the discriminant.
* gcc-interfaces/decl.c (build_subst_list): Convert the expression of
the constraint to the type of the discriminant.
From-SVN: r153054
Diffstat (limited to 'gcc/ada/gcc-interface/decl.c')
-rw-r--r-- | gcc/ada/gcc-interface/decl.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c index 70ced84..d0b52f2 100644 --- a/gcc/ada/gcc-interface/decl.c +++ b/gcc/ada/gcc-interface/decl.c @@ -7374,12 +7374,16 @@ build_subst_list (Entity_Id gnat_subtype, Entity_Id gnat_type, bool definition) gnat_value = Next_Elmt (gnat_value)) /* Ignore access discriminants. */ if (!Is_Access_Type (Etype (Node (gnat_value)))) - gnu_list = tree_cons (gnat_to_gnu_field_decl (gnat_discrim), - elaborate_expression - (Node (gnat_value), gnat_subtype, - get_entity_name (gnat_discrim), definition, - true, false), - gnu_list); + { + tree gnu_field = gnat_to_gnu_field_decl (gnat_discrim); + gnu_list = tree_cons (gnu_field, + convert (TREE_TYPE (gnu_field), + elaborate_expression + (Node (gnat_value), gnat_subtype, + get_entity_name (gnat_discrim), + definition, true, false)), + gnu_list); + } return gnu_list; } |