diff options
author | Arnaud Charlet <charlet@gcc.gnu.org> | 2011-08-29 12:02:08 +0200 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2011-08-29 12:02:08 +0200 |
commit | d3cb4cc0df047020719e5eaa3f5be0c17f256f2c (patch) | |
tree | abc00a0f2d80da97f7ea687746ed421e73d91083 /gcc/ada/par-ch12.adb | |
parent | d3f70b35df36f20ad887de0adc150d0b3dd186cc (diff) | |
download | gcc-d3cb4cc0df047020719e5eaa3f5be0c17f256f2c.zip gcc-d3cb4cc0df047020719e5eaa3f5be0c17f256f2c.tar.gz gcc-d3cb4cc0df047020719e5eaa3f5be0c17f256f2c.tar.bz2 |
[multiple changes]
2011-08-29 Matthew Heaney <heaney@adacore.com>
* a-comutr.adb, a-cimutr.adb, a-cbmutr.adb (Splice_Subtree): Only check
for sibling when common parent.
2011-08-29 Thomas Quinot <quinot@adacore.com>
* get_scos.adb: Literals of Pragma_Id are pragma names prefixed with
"pragma_".
2011-08-29 Ed Schonberg <schonberg@adacore.com>
* sem_ch6.adb (Analyze_Subprogram_Body_Helper): Enable freeze actions
for the return type when in ASIS mode.
2011-08-29 Vincent Celier <celier@adacore.com>
* make.adb (Gnatmake): Get the default search dirs, then the target
parameters after getting the Builder switches, as the Builder switches
may include --RTS= and that could change the default search dirs.
2011-08-29 Hristian Kirtchev <kirtchev@adacore.com>
* exp_ch7.adb (Make_Adjust_Call): Rewrite to mimic the structure of
Make_Final_Call. Move the processing for class-wide types before the
processing for derivations from [Limited_]Controlled.
(Make_Final_Call): Move the processing for class-wide types before the
processing for derivations from [Limited_]Controlled.
* s-stposu.adb (Allocate_Any_Controlled): Correct the membership check.
Add code to account for alignments larger than the list header. Add a
comment illustrating the structure of the allocated object + padding +
header.
(Deallocate_Any_Controlled): Add code to account for alignments larger
than the list header.
2011-08-29 Ed Schonberg <schonberg@adacore.com>
* sinfo.ads, sinfo.adb: New node kind
N_Formal_Incomplete_Type_Definition, related flags.
par-ch12.adb (P_Formal_Type_Declaration, G_Formal_Type_Definition):
Parse formal incomplete types.
* sem.adb (Analyze): Formal_Incomplete_Type_Definitions are handled in
sem_ch12.
* sem_ch7.adb (Analyze_Package_Specification, Unit_Requires_Body):
Formal incomplete types do not need completion.
* sem_ch12.adb (Analyze_Formal_Incomplete_Type,
Validate_Incomplete_Type_Instance): New procedures to handle formal
incomplete types.
* freeze.adb (Freeze_Entity): Do not freeze the subtype of an actual
that corresponds to a formal incomplete type.
* sprint.adb: Handle formal incomplete type declarations.
* exp_util.adb (Insert_Actions): An incomplete_type_definition is not
an insertion point.
From-SVN: r178184
Diffstat (limited to 'gcc/ada/par-ch12.adb')
-rw-r--r-- | gcc/ada/par-ch12.adb | 50 |
1 files changed, 46 insertions, 4 deletions
diff --git a/gcc/ada/par-ch12.adb b/gcc/ada/par-ch12.adb index 49962d8..a7e5242 100644 --- a/gcc/ada/par-ch12.adb +++ b/gcc/ada/par-ch12.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2010, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2011, 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- -- @@ -531,10 +531,39 @@ package body Ch12 is (Decl_Node, P_Known_Discriminant_Part_Opt); end if; - T_Is; + if Token = Tok_Semicolon then + + -- Ada2012 : incomplete formal type + + Scan; -- past semicolon + + if Ada_Version < Ada_2012 then + Error_Msg_N + ("`formal incomplete type` is an Ada 2012 feature", Decl_Node); + Error_Msg_N + ("\unit must be compiled with -gnat2012 switch", Decl_Node); + end if; + + Set_Formal_Type_Definition + (Decl_Node, + New_Node (N_Formal_Incomplete_Type_Definition, Token_Ptr)); + return Decl_Node; + + else + T_Is; + end if; Def_Node := P_Formal_Type_Definition; + if Nkind (Def_Node) = N_Formal_Incomplete_Type_Definition + and then Ada_Version < Ada_2012 + then + Error_Msg_N + ("`formal incomplete type` is an Ada 2012 feature", Decl_Node); + Error_Msg_N + ("\unit must be compiled with -gnat2012 switch", Decl_Node); + end if; + if Def_Node /= Error then Set_Formal_Type_Definition (Decl_Node, Def_Node); P_Aspect_Specifications (Decl_Node); @@ -563,6 +592,7 @@ package body Ch12 is -- FORMAL_TYPE_DEFINITION ::= -- FORMAL_PRIVATE_TYPE_DEFINITION + -- | FORMAL_INCOMPLETE_TYPE_DEFINITION -- | FORMAL_DERIVED_TYPE_DEFINITION -- | FORMAL_DISCRETE_TYPE_DEFINITION -- | FORMAL_SIGNED_INTEGER_TYPE_DEFINITION @@ -704,10 +734,22 @@ package body Ch12 is return Error; end if; - when Tok_Private | - Tok_Tagged => + when Tok_Private => return P_Formal_Private_Type_Definition; + when Tok_Tagged => + if Next_Token_Is (Tok_Semicolon) then + Typedef_Node := + New_Node (N_Formal_Incomplete_Type_Definition, Token_Ptr); + Set_Tagged_Present (Typedef_Node); + + Scan; -- past tagged + return Typedef_Node; + + else + return P_Formal_Private_Type_Definition; + end if; + when Tok_Range => return P_Formal_Signed_Integer_Type_Definition; |