g-comlin.ads, [...]: Add new warning for renaming of function return objects
authorRobert Dewar <dewar@adacore.com>
Wed, 6 Jun 2007 10:29:05 +0000 (12:29 +0200)
committerArnaud Charlet <charlet@gcc.gnu.org>
Wed, 6 Jun 2007 10:29:05 +0000 (12:29 +0200)
commitfbe627afbd02f0e151a772f1bbd00ec8dc13c6a8
tree6ff0bdc51ae48b263304958cee5149a99a48f365
parentf24f72e8928aad26ed15009ef1047de16d0193c2
g-comlin.ads, [...]: Add new warning for renaming of function return objects

2007-04-20  Robert Dewar  <dewar@adacore.com>
    Ed Schonberg  <schonberg@adacore.com>

* g-comlin.ads, g-comlin.adb:
Add new warning for renaming of function return objects

* opt.adb (Tree_Write, Tree_Read): Use proper expressions for size
(Tree_Read): Use size of object instead of type'object_size, since the
latter is incorrect for packed array types.
(Tree_Write): Same fix

* opt.ads: Add new warning for renaming of function return objects
(Generating_Code): New boolean variable used to indicate that the
frontend as finished its work and has called the backend to process
the tree and generate the object file.
(GCC_Version): Is now private
(Static_Dispatch_Tables): New constant declaration.
(Overflow_Checks_Unsuppressed): New flag.
(Process_Suppress_Unsuppress): Set Overflow_Checks_Unsuppressed.
(List_Closure): New flag for gnatbind (-R)
Zero_Formatting: New flag for gnatbind (-Z)
(Special_Exception_Package_Used): New flag.
(Warn_On_Unrepped_Components): New flag.

* sem_ch8.adb (Check_Library_Unit_Renaming): Check that the renamed
unit is a compilation unit, rather than relying on its scope, so that
Standard can be renamed.
(Analyze_Object_Renaming): Add new warning for renaming of function
return objects.
Also reject attempt to rename function return object in Ada 83 mode.
(Attribute_Renaming): In case of tagged types, add the body of the
generated function to the freezing actions of the type.
(Find_Type): A protected type is visible right after the reserved word
"is" is encountered in its type declaration. Set the entity and type
rather than emitting an error message.
(New_Scope): Properly propagate Discard_Names to inner scopes
(Check_Nested_Access): New procedure.
(Has_Nested_Access, Set_Has_Nested_Access): New procedures.
(Find_Direct_Name, Note_Possible_Modification): Use Check_Nested_Access.

* sem_warn.ads, sem_warn.adb: Improvements to infinite loop warning
Add new warning for renaming of function return objects
(Check_References): Suppress warnings for objects whose type or
base type has Warnings suppressed.
(Set_Dot_Warning_Switch): Add processing for -gnatw.c/C
(Set_Warning_Switch): Include new -gnatwc in -gnatwa

From-SVN: r125414
gcc/ada/g-comlin.adb
gcc/ada/g-comlin.ads
gcc/ada/opt.adb
gcc/ada/opt.ads
gcc/ada/sem_ch8.adb
gcc/ada/sem_warn.adb
gcc/ada/sem_warn.ads