This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
| Other format: | [Raw text] | |
Tested on i686-linux, committed on mainline.
Ada 2005 (AI-50217, AI-326): Check wrong dereference of incomplete.
In addition, in case of explicit dereference of incomplete types,
use the non-limited view if available.
--
The whole description of this new feature is available
at http://www.ada-auth.org/cgi-bin/cvsweb.cgi/AIs/AI-00326.TXT
--
Examples of the catched error:
--
limited with P;
package Pkg is
type Acc is access P.T;
A : Acc;
end Pkg;
with Pkg; use Pkg;
procedure Example is
begin
A.all := ... ; -- ERROR
end Example;
--
limited with Pkg;
package P is
type Acc is access Pkg.T;
X : Acc;
S : Integer := X.all'Size; -- ERROR
end P;
--
type T is tagged;
type Acc is access all T;
X : Acc;
S : constant Integer := X.all'Size; -- ERROR
procedure Q (Obj : Integer := X.all'Alignment); -- ERROR
--
type T1 (<>) is tagged;
procedure P (X : access T1); -- ERROR
procedure P (X : T1); -- ERROR
type T2 is tagged;
function F (X : Boolean) return T2; -- ERROR
type Acc_1 is access function (X : T2) return T2; -- ERROR
type Acc_2 is access
protected function (X : Float) return T2; -- ERROR
2005-07-07 Javier Miranda <miranda@adacore.com>
* freeze.adb (Freeze_Entity): Check wrong uses of tag incomplete types.
* par-ch3.adb (P_Type_Declaration): Give support to tagged incomplete
types:
--
type DEFINING_IDENTIFIER [DISCRIMINANT_PART] [IS TAGGED];
--
* sem_attr.adb (Check_Not_Incomplete_Type): Additional checks for wrong
use of tag incomplete types.
* sem_ch3.adb (Analyze_Incomplete_Type): Add mininum decoration to
give support to tagged incomplete types.
* sem_ch5.adb (Analyze_Case_Statement): In generated code, if the
expression is a discriminant reference and its type is private, as can
happen within a stream operation for a mutable record, use the full
view of the type to resolve the case alternatives.
(Analyze_Assignment): Check wrong dereference of incomplete types.
* sem_ch6.adb (Process_Formals): Allow the use of tagged incomplete
types.
* sem_res.adb (Resolve_Explicit_Dereference): Allow the use of tagged
incomplete types.
* sinfo.adb (Taggged_Present/Set_Taggged_Present): Applicable to
N_Incomplete_Type_Declaration nodes.
* sinfo.ads (N_Incomplete_Type_Declaration): Addition of attribute
Tag_Present to give support to tagged incomplete types:
--
type DEFINING_IDENTIFIER [DISCRIMINANT_PART] [IS TAGGED];
--
Attachment:
difs.5
Description: Text document
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |