* freeze.adb (Freeze_Entity, Concurrent_Type case): Add a guard
to make sure that the Etype of a component of the corresponding
record type is present before trying to freeze it.
* sem_ch5.adb: Minor reformatting.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@213165
138bc75d-0d04-0410-961f-
82ee72b054a4
2014-07-29 Robert Dewar <dewar@adacore.com>
+ * freeze.adb (Freeze_Entity, Concurrent_Type case): Add a guard
+ to make sure that the Etype of a component of the corresponding
+ record type is present before trying to freeze it.
+ * sem_ch5.adb: Minor reformatting.
+
+2014-07-29 Robert Dewar <dewar@adacore.com>
+
* exp_attr.adb, types.ads, types.h, exp_ch11.adb, a-except.adb,
a-except-2005.adb: Add new reason code PE_Stream_Operation_Not_Allowed,
and then use it when a stream operation is used from a library generic
Freeze_And_Append (Comp, N, Result);
elsif (Ekind (Comp)) /= E_Function then
- if Is_Itype (Etype (Comp))
- and then Underlying_Type (Scope (Etype (Comp))) = E
- then
- Undelay_Type (Etype (Comp));
- end if;
- Freeze_And_Append (Etype (Comp), N, Result);
+ -- The guard on the presence of the Etype seems to be needed
+ -- for some CodePeer (-gnatcC) cases, but not clear why???
+
+ if Present (Etype (Comp)) then
+ if Is_Itype (Etype (Comp))
+ and then Underlying_Type (Scope (Etype (Comp))) = E
+ then
+ Undelay_Type (Etype (Comp));
+ end if;
+
+ Freeze_And_Append (Etype (Comp), N, Result);
+ end if;
end if;
Next_Entity (Comp);
-- We skip this step if we are not in code generation mode
-- or CodePeer mode.
+
-- This is the one case where we remove dead code in the
-- semantics as opposed to the expander, and we do not want
-- to remove code if we are not in code generation mode,