aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/par-ch4.adb
diff options
context:
space:
mode:
authorRobert Dewar <dewar@adacore.com>2005-03-29 18:18:13 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2005-03-29 18:18:13 +0200
commit4f62e49c97c56fb8ccf2de533e83931a814da45b (patch)
tree85944b247f1d765548f638901c454c7ec6c0c4e7 /gcc/ada/par-ch4.adb
parent6d458cc580dacbd3e52e3203c3acdc9ffdce70ba (diff)
downloadgcc-4f62e49c97c56fb8ccf2de533e83931a814da45b.zip
gcc-4f62e49c97c56fb8ccf2de533e83931a814da45b.tar.gz
gcc-4f62e49c97c56fb8ccf2de533e83931a814da45b.tar.bz2
par-ch4.adb (P_Name): When a bad attribute is returned...
2005-03-29 Robert Dewar <dewar@adacore.com> * par-ch4.adb (P_Name): When a bad attribute is returned, return error, rather than proceed ahead using a junk attribute name. From-SVN: r97179
Diffstat (limited to 'gcc/ada/par-ch4.adb')
-rw-r--r--gcc/ada/par-ch4.adb19
1 files changed, 18 insertions, 1 deletions
diff --git a/gcc/ada/par-ch4.adb b/gcc/ada/par-ch4.adb
index 5826606..a013c23 100644
--- a/gcc/ada/par-ch4.adb
+++ b/gcc/ada/par-ch4.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2004 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 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- --
@@ -402,8 +402,25 @@ package body Ch4 is
if Apostrophe_Should_Be_Semicolon then
Expr_Form := EF_Name;
return Name_Node;
+
+ -- Here for a bad attribute name
+
else
Signal_Bad_Attribute;
+ Scan; -- past bad identifier
+
+ if Token = Tok_Left_Paren then
+ Scan; -- past left paren
+
+ loop
+ Discard_Junk_Node (P_Expression);
+ exit when not Comma_Present;
+ end loop;
+
+ T_Right_Paren;
+ end if;
+
+ return Error;
end if;
end if;