This fixes an undefined symbol at link time in specific cases for functions
that return a discriminated record type with default discriminant. It's a
regression present on the mainline and 5 branch.
Tested on x86_64-suse-linux, applied on the mainline and 5 branch.
2015-06-04 Pierre-Marie de Rodat <dero...@adacore.com>
* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Function>: If
processing a definition, create definitions for padding types
around return types.
--
Eric Botcazou
Index: gcc-interface/decl.c
===================================================================
--- gcc-interface/decl.c (revision 224054)
+++ gcc-interface/decl.c (working copy)
@@ -4252,7 +4252,8 @@ gnat_to_gnu_entity (Entity_Id gnat_entit
= maybe_pad_type (gnu_return_type,
max_size (TYPE_SIZE (gnu_return_type),
true),
- 0, gnat_entity, false, false, false, true);
+ 0, gnat_entity, false, false, definition,
+ true);
/* Declare it now since it will never be declared otherwise.
This is necessary to ensure that its subtrees are properly