2006-10-31 Ed Schonberg <schonberg@adacore.com>
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 31 Oct 2006 18:07:13 +0000 (18:07 +0000)
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 31 Oct 2006 18:07:13 +0000 (18:07 +0000)
commitccf78cbf0aa001b5f4faebedc0fdc4781f540c33
tree1871b0662cc5ad20169a149435da0fc7989acdb0
parent44e4341ecf8c0b57eb5022a2a81893f1c6e0cedf
2006-10-31  Ed Schonberg  <schonberg@adacore.com>
    Javier Miranda  <miranda@adacore.com>
    Robert Dewar  <dewar@adacore.com>

* sem_ch4.adb (Try_Primitive_Operation): Code cleanup to ensure that we
generate the same errors compiling under -gnatc.
(Try_Object_Operation): If no candidate interpretation succeeds, but
there is at least one primitive operation with the right name, report
error in call rather than on a malformed selected component.
(Analyze_Selected_Component): If the prefix is an incomplete type from
a limited view, and the full view is available, use the full view to
determine whether this is a prefixed call to a primitive operation.
(Operator_Check): Verify that a candidate interpretation is a binary
operation before checking the type of its second formal.
(Analyze_Call): Add additional warnings for function call contexts not
yet supported.
(Analyze_Allocator): Move the check for "initialization not allowed for
limited types" after analyzing the expression. This is necessary,
because OK_For_Limited_Init looks at the structure of the expression.
Before analysis, we don't necessarily know what sort of expression it
is. For example, we don't know whether F(X) is a function call or an
indexed component; the former is legal in Ada 2005; the latter is not.
(Analyze_Allocator): Correct code for AI-287 -- extension aggregates
were missing. We also didn't handle qualified expressions. Now also
allow function calls. Use new common routine OK_For_Limited_Init.
(Analyze_Type_Conversion): Do not perform some legality checks in an
instance, because the error message will be redundant or spurious.
(Analyze_Overloaded_Selected_Component): Do not do style check when
setting an entity, since we do not know it is the right entity yet.
(Analyze_Selected_Component): Move Generate_Reference call to Sem_Res
(Analyze_Overloaded_Selected_Component): Same change
(Analyze_Selected_Component): Remove unnecessary prefix type retrieval
since regular incomplete subtypes are transformed into corresponding
subtypes of their full views.
(Complete_Object_Operation): Treat name of transformed subprogram call
as coming from source, for browsing purposes.
(Try_Primitive_Operation): If formal is an access parameter, compare
with base type of object to determine whether it is a primitive
operation.
(Operator_Check): If no interpretation of the operator matches, check
whether a use clause on any candidate might make the operation legal.
(Try_Class_Wide_Operation): Check whether the first parameter is an
access type whose designated type is class-wide.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@118302 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ada/sem_ch4.adb