Patchwork [Ada] Do not skip analysis of aspect X when X'Class aspect present (and reverse)

mail settings
Submitter Arnaud Charlet
Date Aug. 4, 2011, 9:13 a.m.
Message ID <>
Download mbox | patch
Permalink /patch/108386/
State New
Headers show


Arnaud Charlet - Aug. 4, 2011, 9:13 a.m.
Compiling the following code now raises an error:

package P is
   procedure Proc (X : out Boolean)
     with Post'Class => X,
          Post => not X,
          Post => X;
end P;

$ gcc -c -gnat2012 aspect "Post" for "Proc" previously given at line 4

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

2011-08-04  Yannick Moy  <>

	* sem_ch13.adb (Aspect_Loop): when an aspect X and its classwise
	corresponding aspect X'Class are allowed, proceed with analysis of the
	aspect instead of skipping it.


Index: sem_ch13.adb
--- sem_ch13.adb	(revision 177340)
+++ sem_ch13.adb	(working copy)
@@ -854,7 +854,7 @@ 
                      end if;
                   end if;
-                  goto Continue;
+                  --  Allowed case of X and X'Class both specified
                end if;
                Next (Anod);