aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/atree.h
diff options
context:
space:
mode:
authorJustin Squirek <squirek@adacore.com>2018-05-22 13:17:58 +0000
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>2018-05-22 13:17:58 +0000
commiteaf51442d2d20864713492eb0355a9ec4abe0573 (patch)
tree2f2350fe698fb7516c8089b7a5192930c6c3d6f6 /gcc/ada/atree.h
parent80f0c69c2c698023f76d0e5db7e2b42e1fd7b637 (diff)
downloadgcc-eaf51442d2d20864713492eb0355a9ec4abe0573.zip
gcc-eaf51442d2d20864713492eb0355a9ec4abe0573.tar.gz
gcc-eaf51442d2d20864713492eb0355a9ec4abe0573.tar.bz2
[Ada] No error on misplaced pragma Pure_Function
This patch fixes an issue whereby placement of the pragma/aspect Pure_Function was not verified to have been in the same declarative part as the function declaration incorrectly allowing it to appear after a function body or in a different region like a private section. 2018-05-22 Justin Squirek <squirek@adacore.com> gcc/ada/ * sem_ch12.adb (In_Same_Declarative_Part): Moved to sem_util. (Freeze_Subprogram_Body, Install_Body): Modify calls to In_Same_Declarative_Part. * sem_prag.adb (Analyze_Pragma-Pragma_Pure_Function): Add check to verify pragma declaration is within the same declarative list with corresponding error message. * sem_util.adb, sem_util.ads (In_Same_Declarative_Part): Moved from sem_ch12.adb and generalized to be useful outside the scope of freezing. gcc/testsuite/ * gnat.dg/pure_function1.adb, gnat.dg/pure_function1.ads, gnat.dg/pure_function2.adb, gnat.dg/pure_function2.ads: New testcases. From-SVN: r260507
Diffstat (limited to 'gcc/ada/atree.h')
0 files changed, 0 insertions, 0 deletions