[Ada] Properly handle unprefixed references to components

Pierre-Marie de Rodat derodat@adacore.com
Mon May 9 09:30:26 GMT 2022


In some cases, the compiler would incorrectly reject unprefixed uses of
component names in an aspect specification for the composite type.
Correct this error.

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

gcc/ada/

	* sem_ch13.adb (Replace_Type_Ref): In the case of an identifier
	that names a component of the type, simplify the test to decide
	whether to build a prefix for it (the prefix denotes the current
	instance of the enclosing type): if the identifier doesn't
	already have a prefix, then give it one. This isn't quite right
	in the corner case of a quantified expression or some other such
	expression that declares an object with the same name as a
	component, but it is still an improvement.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.diff
Type: text/x-diff
Size: 2277 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-patches/attachments/20220509/37f8214c/attachment.bin>


More information about the Gcc-patches mailing list