+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,
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.
-- 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);
-- --
-- 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- --
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
-- --
-- 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- --
(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).
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