summaryrefslogtreecommitdiff
path: root/gcc/ada/sem_ch7.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2011-08-02 15:51:43 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2011-08-02 15:51:43 +0200
commit4637729f3ee4f001e5c4fec92fe26d13b91d9f97 (patch)
tree7912df75525fc2582825ca39cb64a8b12c8f1039 /gcc/ada/sem_ch7.adb
parent4c60de0c970a2b152748ec3c65f65328b4689471 (diff)
downloadgcc-4637729f3ee4f001e5c4fec92fe26d13b91d9f97.tar.gz
[multiple changes]
2011-08-02 Robert Dewar <dewar@adacore.com> * exp_ch4.adb: Minor reformatting. 2011-08-02 Ed Schonberg <schonberg@adacore.com> * sem_ch5.adb (Analyze_Loop_Statement): If the iteration scheme is an Ada2012 iterator, the loop will be rewritten during expansion into a while loop with a cursor and an element declaration. Do not analyze the body in this case, because if the container is for indefinite types the actual subtype of the elements will only be determined when the cursor declaration is analyzed. 2011-08-02 Arnaud Charlet <charlet@adacore.com> * sem_ch13.adb (Analyze_Attribute_Definition_Clause): Ignore size/alignment related attributes in CodePeer_Mode. 2011-08-02 Gary Dismukes <dismukes@adacore.com> * sem_ch3.adb (Check_Ops_From_Incomplete_Type): Remove call to Prepend_Element, since this can result in the operation getting the wrong slot in the full type's dispatch table if the full type has inherited operations. The incomplete type's operation will get added to the proper position in the full type's primitives list later in Sem_Disp.Check_Operation_From_Incomplete_Type. (Process_Incomplete_Dependents): Add Is_Primitive test when checking for dispatching operations, since there are cases where nonprimitive subprograms can get added to the list of incomplete dependents (such as subprograms in nested packages). * sem_ch6.adb (Process_Formals): First, remove test for being in a private part when determining whether to add a primitive with a parameter of a tagged incomplete type to the Private_Dependents list. Such primitives can also occur in the visible part, and should not have been excluded from being private dependents. * sem_ch7.adb (Uninstall_Declarations): When checking the rule of RM05-3.10.1(9.3/2), test that a subprogram in the Private_Dependents list of a Taft-amendment incomplete type is a primitive before issuing an error that the full type must appear in the same unit. There are cases where nonprimitives can be in the list (such as subprograms in nested packages). * sem_disp.adb (Derives_From): Use correct condition for checking that a formal's type is derived from the type of the corresponding formal in the parent subprogram (the condition was completely wrong). Add checking that was missing for controlling result types being derived from the result type of the parent operation. From-SVN: r177156
Diffstat (limited to 'gcc/ada/sem_ch7.adb')
-rw-r--r--gcc/ada/sem_ch7.adb6
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/ada/sem_ch7.adb b/gcc/ada/sem_ch7.adb
index caf2a73d04b..46d63dc7ab4 100644
--- a/gcc/ada/sem_ch7.adb
+++ b/gcc/ada/sem_ch7.adb
@@ -2463,7 +2463,11 @@ package body Sem_Ch7 is
while Present (Elmt) loop
Subp := Node (Elmt);
- if Is_Overloadable (Subp) then
+ -- Is_Primitive is tested because there can be cases where
+ -- nonprimitive subprograms (in nested packages) are added
+ -- to the Private_Dependents list.
+
+ if Is_Overloadable (Subp) and then Is_Primitive (Subp) then
Error_Msg_NE
("type& must be completed in the private part",
Parent (Subp), Id);