summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2005-09-05 07:59:42 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2005-09-05 07:59:42 +0000
commitd91255814e700c33f1cffa6ddfa71ca0126f02e4 (patch)
treec70e7efa1e98dcf3b2b27b56c326c277b54a16d4
parent31f4099f03ed4fb233943dd9c933b5ae3844addb (diff)
downloadppe42-gcc-d91255814e700c33f1cffa6ddfa71ca0126f02e4.tar.gz
ppe42-gcc-d91255814e700c33f1cffa6ddfa71ca0126f02e4.zip
2005-09-01 Thomas Quinot <quinot@adacore.com>
* sem_ch13.adb (Analyze_Enumeration_Representation_Clause): Reject the clause if the array aggregate is surrounded by parentheses. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@103880 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ada/sem_ch13.adb19
1 files changed, 13 insertions, 6 deletions
diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb
index 10ae9e3a6b9..c1586603857 100644
--- a/gcc/ada/sem_ch13.adb
+++ b/gcc/ada/sem_ch13.adb
@@ -1488,6 +1488,14 @@ package body Sem_Ch13 is
Error_Msg_N ("enumeration rep clause not allowed for this type", N);
return;
+ -- Check that the expression is a proper aggregate (no parentheses)
+
+ elsif Paren_Count (Aggr) /= 0 then
+ Error_Msg
+ ("extra parentheses surrounding aggregate not allowed",
+ First_Sloc (Aggr));
+ return;
+
-- All tests passed, so set rep clause in place
else
@@ -1500,10 +1508,6 @@ package body Sem_Ch13 is
-- normal expansion activities, and a number of special semantic
-- rules apply (including the component type being any integer type)
- -- Badent signals that we found some incorrect entries processing
- -- the list. The final checks for completeness and ordering are
- -- skipped in this case.
-
Elit := First_Literal (Enumtype);
-- First the positional entries if any
@@ -1518,9 +1522,12 @@ package body Sem_Ch13 is
Val := Static_Integer (Expr);
+ -- Err signals that we found some incorrect entries processing
+ -- the list. The final checks for completeness and ordering are
+ -- skipped in this case.
+
if Val = No_Uint then
Err := True;
-
elsif Val < Lo or else Hi < Val then
Error_Msg_N ("value outside permitted range", Expr);
Err := True;
@@ -3124,7 +3131,7 @@ package body Sem_Ch13 is
New_Reference_To (
Designated_Type (Etype (F)), Loc)))),
- Subtype_Mark =>
+ Result_Definition =>
New_Reference_To (Etyp, Loc));
end Build_Spec;
OpenPOWER on IntegriCloud