[Ada] 'others' in conditional_expressions

Pierre-Marie de Rodat derodat@adacore.com
Thu Oct 10 15:29:00 GMT 2019


This patch fixes a bug in which an 'others' array aggregate in a
dependent_expression of a conditional_expression is rejected, even in
cases where 'others' is legal. See RM-4.3.3(15.1).

Running this command:

  gcc -c others_test.ads

On the following sources:

package Others_Test is

   X : String (1 .. 10) := (case True is when Boolean => (others => 'x'));

end Others_Test;

Should execute silently.

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

2019-10-10  Bob Duff  <duff@adacore.com>

gcc/ada/

	* sem_aggr.adb (Resolve_Aggregate): Add missing cases in the
	Others_Allowed => True case -- N_Case_Expression_Alternative and
	N_If_Expression.  Use Nkind_In.
	* atree.adb, atree.ads, sinfo.adb, sinfo.ads (Nkind_In): New
	16-parameter version.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.diff
Type: text/x-diff
Size: 7976 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20191010/11d46d32/attachment.bin>


More information about the Gcc-patches mailing list