[Ada] Crash on declaration with aggregate for unchecked union

Pierre-Marie de Rodat derodat@adacore.com
Mon Jul 6 11:38:54 GMT 2020


This patch fixes a compiler abort on an object declaration whose
expression is an aggregate for an unchecked union type. A declaration
for an object of such a type is otherwise treated as a renaming of the
expression (typically an object of the type), but this does work for an
aggregate, which must be resolved and handled as an initial value of
a regular declaration.

Tested on x86_64-pc-linux-gnu, committed on trunk

gcc/ada/

	* sem_ch3.adb (Analyze_Object_Declaration): If the type is an
	Unchecked_Union, and the expression is an aggregate. complete
	the analysis and resolution of the aggregate, and treat like a
	regular object declaration, instead of as a renaming
	declarattion.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.diff
Type: text/x-diff
Size: 1596 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-patches/attachments/20200706/056724e4/attachment-0001.bin>


More information about the Gcc-patches mailing list