From 15c37a32819eaa1b861b6112ced8f6ed2867117c Mon Sep 17 00:00:00 2001 From: charlet Date: Tue, 29 Mar 2005 16:18:13 +0000 Subject: [PATCH] 2005-03-29 Robert Dewar * par-ch4.adb (P_Name): When a bad attribute is returned, return error, rather than proceed ahead using a junk attribute name. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@97179 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ada/par-ch4.adb | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/gcc/ada/par-ch4.adb b/gcc/ada/par-ch4.adb index 5826606352e..a013c23ae2a 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; -- 2.11.0