aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sinfo.adb
diff options
context:
space:
mode:
authorEd Schonberg <schonberg@adacore.com>2011-09-02 10:07:35 +0000
committerArnaud Charlet <charlet@gcc.gnu.org>2011-09-02 12:07:35 +0200
commit99d520ade527dcb82b6f3057ea571caaeb00c2b7 (patch)
treece09a607f900a207daf6f88246d93c39a6056b95 /gcc/ada/sinfo.adb
parent5b5588dd53fd0da82e406f5de6e9f189f89f1b1a (diff)
downloadgcc-99d520ade527dcb82b6f3057ea571caaeb00c2b7.zip
gcc-99d520ade527dcb82b6f3057ea571caaeb00c2b7.tar.gz
gcc-99d520ade527dcb82b6f3057ea571caaeb00c2b7.tar.bz2
sinfo.ads, sinfo.adb: New semantic attribute Premature_Use...
2011-09-02 Ed Schonberg <schonberg@adacore.com> * sinfo.ads, sinfo.adb: New semantic attribute Premature_Use, present in incomplete type declarations to refine the error message the full declaration is in the same unit. * sem_ch4.adb (Analyze_Selected_Component): If the prefix is of an incomplete type, set the Premature_Use for additional message. * sem_ch3.adb (Find_Type_Name): If partial view is incomplete and Premature_Use is set, place additional information at the point of premature use. From-SVN: r178461
Diffstat (limited to 'gcc/ada/sinfo.adb')
-rw-r--r--gcc/ada/sinfo.adb16
1 files changed, 16 insertions, 0 deletions
diff --git a/gcc/ada/sinfo.adb b/gcc/ada/sinfo.adb
index 67baab9..32d9938 100644
--- a/gcc/ada/sinfo.adb
+++ b/gcc/ada/sinfo.adb
@@ -2459,6 +2459,14 @@ package body Sinfo is
return Node3 (N);
end Prefix;
+ function Premature_Use
+ (N : Node_Id) return Node_Id is
+ begin
+ pragma Assert (False
+ or else NT (N).Nkind = N_Incomplete_Type_Declaration);
+ return Node5 (N);
+ end Premature_Use;
+
function Present_Expr
(N : Node_Id) return Uint is
begin
@@ -5510,6 +5518,14 @@ package body Sinfo is
Set_Node3_With_Parent (N, Val);
end Set_Prefix;
+ procedure Set_Premature_Use
+ (N : Node_Id; Val : Node_Id) is
+ begin
+ pragma Assert (False
+ or else NT (N).Nkind = N_Incomplete_Type_Declaration);
+ Set_Node5 (N, Val);
+ end Set_Premature_Use;
+
procedure Set_Present_Expr
(N : Node_Id; Val : Uint) is
begin