* sem_ch3.adb (Make_Index): Reject properly the use of 'Length
in a discrete range, when 'range was probably intended.
2014-07-31 Robert Dewar <dewar@adacore.com>
* sem_warn.adb, sem_warn.ads (Has_Junk_Name): Moved from body to spec.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@213339
138bc75d-0d04-0410-961f-
82ee72b054a4
+2014-07-31 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_ch3.adb (Make_Index): Reject properly the use of 'Length
+ in a discrete range, when 'range was probably intended.
+
+2014-07-31 Robert Dewar <dewar@adacore.com>
+
+ * sem_warn.adb, sem_warn.ads (Has_Junk_Name): Moved from body to spec.
+
2014-07-31 Robert Dewar <dewar@adacore.com>
* frontend.adb: Minor reformatting.
elsif Nkind (N) = N_Attribute_Reference then
- -- The parser guarantees that the attribute is a RANGE attribute
+ -- Catch beginner's error (use of attribute other than 'Range)
+
+ if Attribute_Name (N) /= Name_Range then
+ Error_Msg_N ("expect attribute ''Range", N);
+ Set_Etype (N, Any_Type);
+ return;
+ end if;
-- If the node denotes the range of a type mark, that is also the
- -- resulting type, and we do no need to create an Itype for it.
+ -- resulting type, and we do not need to create an Itype for it.
if Is_Entity_Name (Prefix (N))
and then Comes_From_Source (N)
-- If E is a parameter entity for a subprogram body, then this function
-- returns the corresponding spec entity, if not, E is returned unchanged.
- function Has_Junk_Name (E : Entity_Id) return Boolean;
- -- Return True if the entity name contains any of the following substrings:
- -- discard
- -- dummy
- -- ignore
- -- junk
- -- unused
- -- Used to suppress warnings on names matching these patterns. The contents
- -- of Name_Buffer and Name_Len are destroyed by this call.
-
function Has_Pragma_Unmodified_Check_Spec (E : Entity_Id) return Boolean;
-- Tests Has_Pragma_Unmodified flag for entity E. If E is not a formal,
-- this is simply the setting of the flag Has_Pragma_Unmodified. If E is
-- --
-- S p e c --
-- --
--- Copyright (C) 1999-2013, Free Software Foundation, Inc. --
+-- Copyright (C) 1999-2014, 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- --
-- block or subprogram to see if there are any variables for which useless
-- assignments were made (assignments whose values were never read).
+ ----------------------
+ -- Utility Routines --
+ ----------------------
+
+ function Has_Junk_Name (E : Entity_Id) return Boolean;
+ -- Return True if the entity name contains any of the following substrings:
+ -- discard
+ -- dummy
+ -- ignore
+ -- junk
+ -- unused
+ -- Used to suppress warnings on names matching these patterns. The contents
+ -- of Name_Buffer and Name_Len are destroyed by this call.
+
end Sem_Warn;