aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sem_attr.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2011-08-02 15:10:33 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2011-08-02 15:10:33 +0200
commitded8909b241d9fd6e60981085c0fd9246392472f (patch)
tree31260f5efb109439c9337953245e792f3b84b436 /gcc/ada/sem_attr.adb
parent70c34e1c94f276d6f306ed92b892cbe7340acd65 (diff)
downloadgcc-ded8909b241d9fd6e60981085c0fd9246392472f.zip
gcc-ded8909b241d9fd6e60981085c0fd9246392472f.tar.gz
gcc-ded8909b241d9fd6e60981085c0fd9246392472f.tar.bz2
[multiple changes]
2011-08-02 Robert Dewar <dewar@adacore.com> * sem_ch3.adb, sem_ch5.adb, sem_type.adb, switch-c.adb, switch-c.ads, sem_prag.adb, sem_util.adb, sem_util.ads, sem_res.adb, warnsw.ads, prepcomp.ads, cstand.adb, stand.ads, a-calfor.adb, s-stusta.adb: Minor reformatting. 2011-08-02 Ed Schonberg <schonberg@adacore.com> * sem_attr.adb: handle properly 'Result when it is a prefix of an indexed component. 2011-08-02 Javier Miranda <miranda@adacore.com> * einfo.ads, einfo.adb (Original_Access_Type): Move this attribute to Node26 since there was an undocumented use of Node21 in E_Access_Subprogram_Type entities which causes conflicts and breaks the generation of the .NET compiler. (Interface_Name): Add missing documentation on JGNAT only uses of this attribute. From-SVN: r177145
Diffstat (limited to 'gcc/ada/sem_attr.adb')
-rw-r--r--gcc/ada/sem_attr.adb16
1 files changed, 16 insertions, 0 deletions
diff --git a/gcc/ada/sem_attr.adb b/gcc/ada/sem_attr.adb
index 35f27ba..f75f36e 100644
--- a/gcc/ada/sem_attr.adb
+++ b/gcc/ada/sem_attr.adb
@@ -4046,6 +4046,22 @@ package body Sem_Attr is
Error_Attr;
end if;
+ -- The attribute reference is a primary. If expressions follow,
+ -- the attribute reference is really an indexable object, so
+ -- rewrite and analyze as an indexed component.
+
+ if Present (E1) then
+ Rewrite (N,
+ Make_Indexed_Component (Loc,
+ Prefix =>
+ Make_Attribute_Reference (Loc,
+ Prefix => Relocate_Node (Prefix (N)),
+ Attribute_Name => Name_Result),
+ Expressions => Expressions (N)));
+ Analyze (N);
+ return;
+ end if;
+
Set_Etype (N, Etype (CS));
-- If several functions with that name are visible,