[Ada] Bad warning: Size in Compile_Time_Error in nested instance

Pierre-Marie de Rodat derodat@adacore.com
Mon Dec 16 10:38:00 GMT 2019

This patch fixes a bug in which if a Size attribute occurs in a pragma
Compile_Time_Error, and the pragma occurs in a generic unit that is
instantiated in another generic unit, and that other generic unit is
instantiated, then the compiler does not know the value of Size at
compile time. It issues a warning in the nested instance:

    warning: in instantiation at ...
    warning: in instantiation at ...
    warning: condition is not known at compile time

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

2019-12-16  Bob Duff  <duff@adacore.com>


	* sem_attr.adb (Analyze_Attribute): Use Known_RM_Size. But we
	still need Size_Known_At_Compile_Time, because when the size
	really is known, sometimes only one or the other of these is
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.diff
Type: text/x-diff
Size: 1041 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20191216/5f67752a/attachment.bin>

More information about the Gcc-patches mailing list