aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sem_attr.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2010-10-12 11:10:13 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2010-10-12 11:10:13 +0200
commit718deaf1af8c923d15f417fd3b49ba909c5f26eb (patch)
tree34e72a80fb14595699c393795268345a17abec04 /gcc/ada/sem_attr.adb
parent6832435e85ed5dca261f6ae041e9f78e5ccfa285 (diff)
downloadgcc-718deaf1af8c923d15f417fd3b49ba909c5f26eb.zip
gcc-718deaf1af8c923d15f417fd3b49ba909c5f26eb.tar.gz
gcc-718deaf1af8c923d15f417fd3b49ba909c5f26eb.tar.bz2
[multiple changes]
2010-10-12 Robert Dewar <dewar@adacore.com> * 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 <ebotcazou@adacore.com> * usage.adb (usage): Adjust line for -gnatn switch. 2010-10-12 Robert Dewar <dewar@adacore.com> * sem_attr.adb (Eval_Attribute): Only leave change active for aspect spec case. 2010-10-12 Ed Schonberg <schonberg@adacore.com> * 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
Diffstat (limited to 'gcc/ada/sem_attr.adb')
-rw-r--r--gcc/ada/sem_attr.adb35
1 files changed, 28 insertions, 7 deletions
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).