From 718deaf1af8c923d15f417fd3b49ba909c5f26eb Mon Sep 17 00:00:00 2001 From: Arnaud Charlet Date: Tue, 12 Oct 2010 11:10:13 +0200 Subject: [multiple changes] 2010-10-12 Robert Dewar * aspects.ads, aspects.adb (Move_Aspects): New procedure. * atree.ads, atree.adb: (New_Copy): Does not copy aspect specifications * sinfo.ads, par-ch3.adb, par-ch6.adb, par-ch7.adb, par-ch9.adb, par-endh.adb, par-ch13.adb, par-ch12.adb: Modify grammar to include aspect specifications. Recognize aspect specifications for all cases * par.adb: Recognize aspect specifications for all cases * sem_ch12.ads, sem_ch12.adb (Copy_Generic_Node): Copies aspect specifications. * sem_ch3.adb (Analyze_Subtype_Declaration): Improve patch to freeze generic actual types (was missing some guards before). * sem_ch9.adb (Analyze_Single_Protected_Declaration): Copy aspects to generated object (Analyze_Single_Task_Declaration): Copy aspects to generated object 2010-10-12 Eric Botcazou * usage.adb (usage): Adjust line for -gnatn switch. 2010-10-12 Robert Dewar * sem_attr.adb (Eval_Attribute): Only leave change active for aspect spec case. 2010-10-12 Ed Schonberg * sem_ch6.adb (Analyze_Subprogram_Declaration): If this is a declaration of a null procedure resolve the types of the profile of the generated null body now. From-SVN: r165353 --- gcc/ada/sem_attr.adb | 35 ++++++++++++++++++++++++++++------- 1 file changed, 28 insertions(+), 7 deletions(-) (limited to 'gcc/ada/sem_attr.adb') diff --git a/gcc/ada/sem_attr.adb b/gcc/ada/sem_attr.adb index 1dd183d..469e77c 100644 --- a/gcc/ada/sem_attr.adb +++ b/gcc/ada/sem_attr.adb @@ -5371,16 +5371,37 @@ package body Sem_Attr is -- P; -- end; - -- which shouold print 64 rather than 32. The exclusion of non-source + -- which should print 64 rather than 32. The exclusion of non-source -- constructs from this test comes from some internal usage in packed -- arrays, which otherwise fails, could use more analysis perhaps??? - if In_Spec_Expression - and then Comes_From_Source (N) - and then not (Is_Entity_Name (P) and then Is_Frozen (Entity (P))) - then - return; - end if; + declare + function Within_Aspect (N : Node_Id) return Boolean; + -- True if within aspect expression. Giant kludge, do this test only + -- within an aspect, since doing it more widely, even though clearly + -- correct, causes regressions notably in GA19-001 ??? + + function Within_Aspect (N : Node_Id) return Boolean + is + begin + if No (Parent (N)) then + return False; + elsif Nkind (N) = N_Aspect_Specification then + return True; + else + return Within_Aspect (Parent (N)); + end if; + end Within_Aspect; + + begin + if In_Spec_Expression + and then Comes_From_Source (N) + and then not (Is_Entity_Name (P) and then Is_Frozen (Entity (P))) + and then Within_Aspect (N) + then + return; + end if; + end; -- Acquire first two expressions (at the moment, no attributes take more -- than two expressions in any case). -- cgit v1.1