aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2011-08-03 11:26:00 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2011-08-03 11:26:00 +0200
commit4ee646da946cc32932a71e3675898043d2e905c0 (patch)
tree44d0794384ea7cc0d8bf1820e3f80fa5cb9211e7 /gcc
parentc0e538ad8071a46fc28634e622faa5a51bf81807 (diff)
downloadgcc-4ee646da946cc32932a71e3675898043d2e905c0.zip
gcc-4ee646da946cc32932a71e3675898043d2e905c0.tar.gz
gcc-4ee646da946cc32932a71e3675898043d2e905c0.tar.bz2
[multiple changes]
2011-08-03 Ed Schonberg <schonberg@adacore.com> * sem_ch6.adb: guard against error nodes in return statements. 2011-08-03 Arnaud Charlet <charlet@adacore.com> * errout.adb (Error_Msg_Internal): the main unit has not been read yet, a warning can only appear on a configuration file, so emit warning without further checks. 2011-08-03 Arnaud Charlet <charlet@adacore.com> * s-interr.ads: add overriding keyword. 2011-08-03 Geert Bosch <bosch@adacore.com> * exp_attr.adb: Fix minor typo. 2011-08-03 Ed Schonberg <schonberg@adacore.com> * par-ch4.adb: improve error recovery. From-SVN: r177245
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/ChangeLog22
-rw-r--r--gcc/ada/errout.adb6
-rw-r--r--gcc/ada/exp_attr.adb2
-rw-r--r--gcc/ada/par-ch4.adb16
-rw-r--r--gcc/ada/s-interr.ads3
-rw-r--r--gcc/ada/sem_ch6.adb15
6 files changed, 57 insertions, 7 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 1c1cf9b..9fb4ce8 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,25 @@
+2011-08-03 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_ch6.adb: guard against error nodes in return statements.
+
+2011-08-03 Arnaud Charlet <charlet@adacore.com>
+
+ * errout.adb (Error_Msg_Internal): the main unit has not been read yet,
+ a warning can only appear on a configuration file, so emit warning
+ without further checks.
+
+2011-08-03 Arnaud Charlet <charlet@adacore.com>
+
+ * s-interr.ads: add overriding keyword.
+
+2011-08-03 Geert Bosch <bosch@adacore.com>
+
+ * exp_attr.adb: Fix minor typo.
+
+2011-08-03 Ed Schonberg <schonberg@adacore.com>
+
+ * par-ch4.adb: improve error recovery.
+
2011-08-03 Emmanuel Briot <briot@adacore.com>
* prj-part.adb, prj-part.ads, prj-makr.adb, prj-pars.adb, prj-conf.adb,
diff --git a/gcc/ada/errout.adb b/gcc/ada/errout.adb
index e794057..49068ef 100644
--- a/gcc/ada/errout.adb
+++ b/gcc/ada/errout.adb
@@ -751,6 +751,12 @@ package body Errout is
if In_Extended_Main_Source_Unit (Sptr) then
null;
+ -- If the main unit has not been read yet. the warning must be on
+ -- a configuration file: gnat.adc or user-defined.
+
+ elsif No (Cunit (Main_Unit)) then
+ null;
+
-- If the flag location is not in the main extended source unit, then
-- we want to eliminate the warning, unless it is in the extended
-- main code unit and we want warnings on the instance.
diff --git a/gcc/ada/exp_attr.adb b/gcc/ada/exp_attr.adb
index a2c2bcc..686bf04 100644
--- a/gcc/ada/exp_attr.adb
+++ b/gcc/ada/exp_attr.adb
@@ -4998,7 +4998,7 @@ package body Exp_Attr is
-- Value --
-----------
- -- Value attribute is handled in separate unti Exp_Imgv
+ -- Value attribute is handled in separate unit Exp_Imgv
when Attribute_Value =>
Exp_Imgv.Expand_Value_Attribute (N);
diff --git a/gcc/ada/par-ch4.adb b/gcc/ada/par-ch4.adb
index 4c25c3c..8d45b2c 100644
--- a/gcc/ada/par-ch4.adb
+++ b/gcc/ada/par-ch4.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2010, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2011, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -606,8 +606,18 @@ package body Ch4 is
raise Error_Resync;
elsif Token /= Tok_Right_Paren then
- T_Right_Paren;
- raise Error_Resync;
+ if Token = Tok_Arrow then
+
+ -- This may be an aggregate that is missing a qualification
+
+ Error_Msg_SC
+ ("context of aggregate must be a qualified expression");
+ raise Error_Resync;
+
+ else
+ T_Right_Paren;
+ raise Error_Resync;
+ end if;
else
Scan; -- past right paren
diff --git a/gcc/ada/s-interr.ads b/gcc/ada/s-interr.ads
index 3b66f06..1d936f5 100644
--- a/gcc/ada/s-interr.ads
+++ b/gcc/ada/s-interr.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2009, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2011, Free Software Foundation, Inc. --
-- --
-- GNARL is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -256,6 +256,7 @@ package System.Interrupts is
(Object : access Static_Interrupt_Protection) return Boolean;
-- Returns True
+ overriding
procedure Finalize (Object : in out Static_Interrupt_Protection);
-- Restore previous handlers as required by C.3.1(12) then call
-- Finalize (Protection).
diff --git a/gcc/ada/sem_ch6.adb b/gcc/ada/sem_ch6.adb
index d487921..11c807b 100644
--- a/gcc/ada/sem_ch6.adb
+++ b/gcc/ada/sem_ch6.adb
@@ -628,8 +628,19 @@ package body Sem_Ch6 is
if Nkind (N) = N_Simple_Return_Statement then
Expr := Expression (N);
- Analyze_And_Resolve (Expr, R_Type);
- Check_Limited_Return (Expr);
+
+ -- Guard against a malformed expression. The parser may have
+ -- tried to recover but the node is not analyzable.
+
+ if Nkind (Expr) = N_Error then
+ Set_Etype (Expr, Any_Type);
+ Expander_Mode_Save_And_Set (False);
+ return;
+
+ else
+ Analyze_And_Resolve (Expr, R_Type);
+ Check_Limited_Return (Expr);
+ end if;
-- RETURN only allowed in SPARK is as the last statement function