summaryrefslogtreecommitdiffstats
path: root/gcc/ada/sem_attr.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2011-12-12 11:52:04 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2011-12-12 11:52:04 +0000
commit38568705a1c44aa183b41a8db6567e02b6f8b54a (patch)
tree47e75a0a07789fbe0929f7955dd7427cfbfb0c0b /gcc/ada/sem_attr.adb
parent693b08225e50adb104ff6da9a4fdb918bb9de908 (diff)
downloadppe42-gcc-38568705a1c44aa183b41a8db6567e02b6f8b54a.tar.gz
ppe42-gcc-38568705a1c44aa183b41a8db6567e02b6f8b54a.zip
2011-12-12 Gary Dismukes <dismukes@adacore.com>
* freeze.adb (Freeze_Expression): Allow freezing of static scalar subtypes that are prefixes of an attribute, even if not yet marked static. Such attributes will get marked as static later in Eval_Attribute (as called from Resolve_Attribute). * sem_attr.adb (Eval_Attribute): Remove wrong code that does an early return for attribute prefixes that are unfrozen source-level types. This code was incorrectly bypassing folding of unfrozen static subtype attributes in default expressions (the executable example in the now-deleted comment was in fact illegal). 2011-12-12 Robert Dewar <dewar@adacore.com> * a-coinve.adb, sem_res.adb, prj-nmsc.adb, a-cobove.adb, a-convec.adb, gnatls.adb, sem_ch13.adb, prj-env.adb, prj-env.ads: Minor reformatting. 2011-12-12 Tristan Gingold <gingold@adacore.com> * gsocket.h: Adjust previous patch. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@182228 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/sem_attr.adb')
-rw-r--r--gcc/ada/sem_attr.adb34
1 files changed, 0 insertions, 34 deletions
diff --git a/gcc/ada/sem_attr.adb b/gcc/ada/sem_attr.adb
index d4c78b83521..f72bebdba7b 100644
--- a/gcc/ada/sem_attr.adb
+++ b/gcc/ada/sem_attr.adb
@@ -5618,40 +5618,6 @@ package body Sem_Attr is
-- Start of processing for Eval_Attribute
begin
- -- No folding in spec expression that comes from source where the prefix
- -- is an unfrozen entity. This avoids premature folding in cases like:
-
- -- procedure DefExprAnal is
- -- type R is new Integer;
- -- procedure P (Arg : Integer := R'Size);
- -- for R'Size use 64;
- -- procedure P (Arg : Integer := R'Size) is
- -- begin
- -- Put_Line (Arg'Img);
- -- end P;
- -- begin
- -- P;
- -- end;
-
- -- 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???
-
- -- We do however go ahead with generic actual types, otherwise we get
- -- some regressions, probably these types should be frozen anyway???
-
- if In_Spec_Expression
- and then Comes_From_Source (N)
- and then not (Is_Entity_Name (P)
- and then
- (Is_Frozen (Entity (P))
- or else (Is_Type (Entity (P))
- and then
- Is_Generic_Actual_Type (Entity (P)))))
- then
- return;
- end if;
-
-- Acquire first two expressions (at the moment, no attributes take more
-- than two expressions in any case).
OpenPOWER on IntegriCloud