aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/prj-dect.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2014-08-04 11:57:00 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2014-08-04 11:57:00 +0200
commitbb304287342b02608f8df217b65f2a93f65ae90c (patch)
treef018ecd5df9867a82b2f011873e67be25b6d4580 /gcc/ada/prj-dect.adb
parent7ed571892e5a8d10c14a674e38b980f60115ceb6 (diff)
downloadgcc-bb304287342b02608f8df217b65f2a93f65ae90c.zip
gcc-bb304287342b02608f8df217b65f2a93f65ae90c.tar.gz
gcc-bb304287342b02608f8df217b65f2a93f65ae90c.tar.bz2
[multiple changes]
2014-08-04 Vincent Celier <celier@adacore.com> * prj-dect.adb (Parse_Case_Construction): It is no longer an error if the variable for a case construction is not typed, only if the variable value is not a single string. Call Parse_Choice_List and End_Case_Construction with the new parameter to indicate that the variable is typed. * prj-strt.adb (End_Case_Construction): Only check the labels if the variable is typed. If the variable is not typed, issue a warning when there is no "when others" allternative. (Parse_Choice_List): Manage the labels only if the variable is typed. * prj-strt.ads (End_Case_Construction): New Boolean parameter String_Type. (Parse_Choice_List): Ditto. 2014-08-04 Ed Schonberg <schonberg@adacore.com> * sem_ch5.adb: Additional fix to Check_Predicate_Use. 2014-08-04 Vincent Celier <celier@adacore.com> * projects.texi: Update documentation of case constructions with variables that are not typed. 2014-08-04 Ed Schonberg <schonberg@adacore.com> * sem_ch8.adb (Build_Class_Wide_Wrapper): If the operator carries an Eliminated pragma, indicate that the wrapper is also to be eliminated, to prevent spurious errors when using gnatelim on programs that include box-initialization of equality operators (consequence of AI05-071).. 2014-08-04 Robert Dewar <dewar@adacore.com> * checks.adb (Activate_Overflow_Check): Handle floating-point case correctly. * checks.ads (Activate_Overflow_Check): Clarify handling of floating-point cases. * exp_util.adb (Check_Float_Op_Overflow): Reset Do_Overflow_Check flag if we generate an explicit overflow check (for Check_Float_Overflow mode). From-SVN: r213550
Diffstat (limited to 'gcc/ada/prj-dect.adb')
-rw-r--r--gcc/ada/prj-dect.adb10
1 files changed, 6 insertions, 4 deletions
diff --git a/gcc/ada/prj-dect.adb b/gcc/ada/prj-dect.adb
index 9053cfc..672c454 100644
--- a/gcc/ada/prj-dect.adb
+++ b/gcc/ada/prj-dect.adb
@@ -827,11 +827,11 @@ package body Prj.Dect is
if Present (Case_Variable) then
String_Type := String_Type_Of (Case_Variable, In_Tree);
- if No (String_Type) then
+ if Expression_Kind_Of (Case_Variable, In_Tree) /= Single then
Error_Msg (Flags,
"variable """ &
Get_Name_String (Name_Of (Case_Variable, In_Tree)) &
- """ is not typed",
+ """ is not a single string",
Variable_Location);
end if;
end if;
@@ -914,7 +914,8 @@ package body Prj.Dect is
Parse_Choice_List
(In_Tree => In_Tree,
First_Choice => First_Choice,
- Flags => Flags);
+ Flags => Flags,
+ String_Type => Present (String_Type));
Set_First_Choice_Of (Current_Item, In_Tree, To => First_Choice);
Expect (Tok_Arrow, "`=>`");
@@ -941,7 +942,8 @@ package body Prj.Dect is
End_Case_Construction
(Check_All_Labels => not When_Others and not Quiet_Output,
Case_Location => Location_Of (Case_Construction, In_Tree),
- Flags => Flags);
+ Flags => Flags,
+ String_Type => Present (String_Type));
Expect (Tok_End, "`END CASE`");
Remove_Next_End_Node;