| 1 |
.. _Implementation_of_Ada_2012_Features: |
| 2 |
|
| 3 |
*********************************** |
| 4 |
Implementation of Ada 2012 Features |
| 5 |
*********************************** |
| 6 |
|
| 7 |
.. index:: Ada 2012 implementation status |
| 8 |
|
| 9 |
.. index:: -gnat12 option (gcc) |
| 10 |
|
| 11 |
.. index:: pragma Ada_2012 |
| 12 |
|
| 13 |
.. index:: configuration pragma Ada_2012 |
| 14 |
|
| 15 |
.. index:: Ada_2012 configuration pragma |
| 16 |
|
| 17 |
This chapter contains a complete list of Ada 2012 features that have been |
| 18 |
implemented. |
| 19 |
Generally, these features are only |
| 20 |
available if the *-gnat12* (Ada 2012 features enabled) option is set, |
| 21 |
which is the default behavior, |
| 22 |
or if the configuration pragma ``Ada_2012`` is used. |
| 23 |
|
| 24 |
However, new pragmas, attributes, and restrictions are |
| 25 |
unconditionally available, since the Ada 95 standard allows the addition of |
| 26 |
new pragmas, attributes, and restrictions (there are exceptions, which are |
| 27 |
documented in the individual descriptions), and also certain packages |
| 28 |
were made available in earlier versions of Ada. |
| 29 |
|
| 30 |
An ISO date (YYYY-MM-DD) appears in parentheses on the description line. |
| 31 |
This date shows the implementation date of the feature. Any wavefront |
| 32 |
subsequent to this date will contain the indicated feature, as will any |
| 33 |
subsequent releases. A date of 0000-00-00 means that GNAT has always |
| 34 |
implemented the feature, or implemented it as soon as it appeared as a |
| 35 |
binding interpretation. |
| 36 |
|
| 37 |
Each feature corresponds to an Ada Issue ('AI') approved by the Ada |
| 38 |
standardization group (ISO/IEC JTC1/SC22/WG9) for inclusion in Ada 2012. |
| 39 |
The features are ordered based on the relevant sections of the Ada |
| 40 |
Reference Manual ("RM"). When a given AI relates to multiple points |
| 41 |
in the RM, the earliest is used. |
| 42 |
|
| 43 |
A complete description of the AIs may be found in |
| 44 |
http://www.ada-auth.org/ai05-summary.html. |
| 45 |
|
| 46 |
.. index:: AI-0002 (Ada 2012 feature) |
| 47 |
|
| 48 |
* *AI-0002 Export C with unconstrained arrays (0000-00-00)* |
| 49 |
|
| 50 |
The compiler is not required to support exporting an Ada subprogram with |
| 51 |
convention C if there are parameters or a return type of an unconstrained |
| 52 |
array type (such as ``String``). GNAT allows such declarations but |
| 53 |
generates warnings. It is possible, but complicated, to write the |
| 54 |
corresponding C code and certainly such code would be specific to GNAT and |
| 55 |
non-portable. |
| 56 |
|
| 57 |
RM References: B.01 (17) B.03 (62) B.03 (71.1/2) |
| 58 |
|
| 59 |
.. index:: AI-0003 (Ada 2012 feature) |
| 60 |
|
| 61 |
* *AI-0003 Qualified expressions as names (2010-07-11)* |
| 62 |
|
| 63 |
In Ada 2012, a qualified expression is considered to be syntactically a name, |
| 64 |
meaning that constructs such as ``A'(F(X)).B`` are now legal. This is |
| 65 |
useful in disambiguating some cases of overloading. |
| 66 |
|
| 67 |
RM References: 3.03 (11) 3.03 (21) 4.01 (2) 4.04 (7) 4.07 (3) |
| 68 |
5.04 (7) |
| 69 |
|
| 70 |
.. index:: AI-0007 (Ada 2012 feature) |
| 71 |
|
| 72 |
* *AI-0007 Stream read and private scalar types (0000-00-00)* |
| 73 |
|
| 74 |
The RM as written appeared to limit the possibilities of declaring read |
| 75 |
attribute procedures for private scalar types. This limitation was not |
| 76 |
intended, and has never been enforced by GNAT. |
| 77 |
|
| 78 |
RM References: 13.13.02 (50/2) 13.13.02 (51/2) |
| 79 |
|
| 80 |
.. index:: AI-0008 (Ada 2012 feature) |
| 81 |
|
| 82 |
* *AI-0008 General access to constrained objects (0000-00-00)* |
| 83 |
|
| 84 |
The wording in the RM implied that if you have a general access to a |
| 85 |
constrained object, it could be used to modify the discriminants. This was |
| 86 |
obviously not intended. ``Constraint_Error`` should be raised, and GNAT |
| 87 |
has always done so in this situation. |
| 88 |
|
| 89 |
RM References: 3.03 (23) 3.10.02 (26/2) 4.01 (9) 6.04.01 (17) 8.05.01 (5/2) |
| 90 |
|
| 91 |
.. index:: AI-0009 (Ada 2012 feature) |
| 92 |
|
| 93 |
* *AI-0009 Pragma Independent[_Components] (2010-07-23)* |
| 94 |
|
| 95 |
This AI introduces the new pragmas ``Independent`` and |
| 96 |
``Independent_Components``, |
| 97 |
which control guaranteeing independence of access to objects and components. |
| 98 |
The AI also requires independence not unaffected by confirming rep clauses. |
| 99 |
|
| 100 |
RM References: 9.10 (1) 13.01 (15/1) 13.02 (9) 13.03 (13) C.06 (2) |
| 101 |
C.06 (4) C.06 (6) C.06 (9) C.06 (13) C.06 (14) |
| 102 |
|
| 103 |
.. index:: AI-0012 (Ada 2012 feature) |
| 104 |
|
| 105 |
* *AI-0012 Pack/Component_Size for aliased/atomic (2010-07-15)* |
| 106 |
|
| 107 |
It is now illegal to give an inappropriate component size or a pragma |
| 108 |
``Pack`` that attempts to change the component size in the case of atomic |
| 109 |
or aliased components. Previously GNAT ignored such an attempt with a |
| 110 |
warning. |
| 111 |
|
| 112 |
RM References: 13.02 (6.1/2) 13.02 (7) C.06 (10) C.06 (11) C.06 (21) |
| 113 |
|
| 114 |
.. index:: AI-0015 (Ada 2012 feature) |
| 115 |
|
| 116 |
* *AI-0015 Constant return objects (0000-00-00)* |
| 117 |
|
| 118 |
The return object declared in an *extended_return_statement* may be |
| 119 |
declared constant. This was always intended, and GNAT has always allowed it. |
| 120 |
|
| 121 |
RM References: 6.05 (2.1/2) 3.03 (10/2) 3.03 (21) 6.05 (5/2) |
| 122 |
6.05 (5.7/2) |
| 123 |
|
| 124 |
.. index:: AI-0017 (Ada 2012 feature) |
| 125 |
|
| 126 |
* *AI-0017 Freezing and incomplete types (0000-00-00)* |
| 127 |
|
| 128 |
So-called 'Taft-amendment types' (i.e., types that are completed in package |
| 129 |
bodies) are not frozen by the occurrence of bodies in the |
| 130 |
enclosing declarative part. GNAT always implemented this properly. |
| 131 |
|
| 132 |
RM References: 13.14 (3/1) |
| 133 |
|
| 134 |
.. index:: AI-0019 (Ada 2012 feature) |
| 135 |
|
| 136 |
* *AI-0019 Freezing of primitives for tagged types (0000-00-00)* |
| 137 |
|
| 138 |
The RM suggests that primitive subprograms of a specific tagged type are |
| 139 |
frozen when the tagged type is frozen. This would be an incompatible change |
| 140 |
and is not intended. GNAT has never attempted this kind of freezing and its |
| 141 |
behavior is consistent with the recommendation of this AI. |
| 142 |
|
| 143 |
RM References: 13.14 (2) 13.14 (3/1) 13.14 (8.1/1) 13.14 (10) 13.14 (14) 13.14 (15.1/2) |
| 144 |
|
| 145 |
.. index:: AI-0026 (Ada 2012 feature) |
| 146 |
|
| 147 |
* *AI-0026 Missing rules for Unchecked_Union (2010-07-07)* |
| 148 |
|
| 149 |
Record representation clauses concerning Unchecked_Union types cannot mention |
| 150 |
the discriminant of the type. The type of a component declared in the variant |
| 151 |
part of an Unchecked_Union cannot be controlled, have controlled components, |
| 152 |
nor have protected or task parts. If an Unchecked_Union type is declared |
| 153 |
within the body of a generic unit or its descendants, then the type of a |
| 154 |
component declared in the variant part cannot be a formal private type or a |
| 155 |
formal private extension declared within the same generic unit. |
| 156 |
|
| 157 |
RM References: 7.06 (9.4/2) B.03.03 (9/2) B.03.03 (10/2) |
| 158 |
|
| 159 |
.. index:: AI-0030 (Ada 2012 feature) |
| 160 |
|
| 161 |
* *AI-0030 Requeue on synchronized interfaces (2010-07-19)* |
| 162 |
|
| 163 |
Requeue is permitted to a protected, synchronized or task interface primitive |
| 164 |
providing it is known that the overriding operation is an entry. Otherwise |
| 165 |
the requeue statement has the same effect as a procedure call. Use of pragma |
| 166 |
``Implemented`` provides a way to impose a static requirement on the |
| 167 |
overriding operation by adhering to one of the implementation kinds: entry, |
| 168 |
protected procedure or any of the above. |
| 169 |
|
| 170 |
RM References: 9.05 (9) 9.05.04 (2) 9.05.04 (3) 9.05.04 (5) |
| 171 |
9.05.04 (6) 9.05.04 (7) 9.05.04 (12) |
| 172 |
|
| 173 |
.. index:: AI-0031 (Ada 2012 feature) |
| 174 |
|
| 175 |
* *AI-0031 Add From parameter to Find_Token (2010-07-25)* |
| 176 |
|
| 177 |
A new version of ``Find_Token`` is added to all relevant string packages, |
| 178 |
with an extra parameter ``From``. Instead of starting at the first |
| 179 |
character of the string, the search for a matching Token starts at the |
| 180 |
character indexed by the value of ``From``. |
| 181 |
These procedures are available in all versions of Ada |
| 182 |
but if used in versions earlier than Ada 2012 they will generate a warning |
| 183 |
that an Ada 2012 subprogram is being used. |
| 184 |
|
| 185 |
RM References: A.04.03 (16) A.04.03 (67) A.04.03 (68/1) A.04.04 (51) |
| 186 |
A.04.05 (46) |
| 187 |
|
| 188 |
.. index:: AI-0032 (Ada 2012 feature) |
| 189 |
|
| 190 |
* *AI-0032 Extended return for class-wide functions (0000-00-00)* |
| 191 |
|
| 192 |
If a function returns a class-wide type, the object of an extended return |
| 193 |
statement can be declared with a specific type that is covered by the class- |
| 194 |
wide type. This has been implemented in GNAT since the introduction of |
| 195 |
extended returns. Note AI-0103 complements this AI by imposing matching |
| 196 |
rules for constrained return types. |
| 197 |
|
| 198 |
RM References: 6.05 (5.2/2) 6.05 (5.3/2) 6.05 (5.6/2) 6.05 (5.8/2) |
| 199 |
6.05 (8/2) |
| 200 |
|
| 201 |
.. index:: AI-0033 (Ada 2012 feature) |
| 202 |
|
| 203 |
* *AI-0033 Attach/Interrupt_Handler in generic (2010-07-24)* |
| 204 |
|
| 205 |
Neither of these two pragmas may appear within a generic template, because |
| 206 |
the generic might be instantiated at other than the library level. |
| 207 |
|
| 208 |
RM References: 13.11.02 (16) C.03.01 (7/2) C.03.01 (8/2) |
| 209 |
|
| 210 |
.. index:: AI-0034 (Ada 2012 feature) |
| 211 |
|
| 212 |
* *AI-0034 Categorization of limited views (0000-00-00)* |
| 213 |
|
| 214 |
The RM makes certain limited with clauses illegal because of categorization |
| 215 |
considerations, when the corresponding normal with would be legal. This is |
| 216 |
not intended, and GNAT has always implemented the recommended behavior. |
| 217 |
|
| 218 |
RM References: 10.02.01 (11/1) 10.02.01 (17/2) |
| 219 |
|
| 220 |
.. index:: AI-0035 (Ada 2012 feature) |
| 221 |
|
| 222 |
* *AI-0035 Inconsistencies with Pure units (0000-00-00)* |
| 223 |
|
| 224 |
This AI remedies some inconsistencies in the legality rules for Pure units. |
| 225 |
Derived access types are legal in a pure unit (on the assumption that the |
| 226 |
rule for a zero storage pool size has been enforced on the ancestor type). |
| 227 |
The rules are enforced in generic instances and in subunits. GNAT has always |
| 228 |
implemented the recommended behavior. |
| 229 |
|
| 230 |
RM References: 10.02.01 (15.1/2) 10.02.01 (15.4/2) 10.02.01 (15.5/2) 10.02.01 (17/2) |
| 231 |
|
| 232 |
.. index:: AI-0037 (Ada 2012 feature) |
| 233 |
|
| 234 |
* *AI-0037 Out-of-range box associations in aggregate (0000-00-00)* |
| 235 |
|
| 236 |
This AI confirms that an association of the form ``Indx => <>`` in an |
| 237 |
array aggregate must raise ``Constraint_Error`` if ``Indx`` |
| 238 |
is out of range. The RM specified a range check on other associations, but |
| 239 |
not when the value of the association was defaulted. GNAT has always inserted |
| 240 |
a constraint check on the index value. |
| 241 |
|
| 242 |
RM References: 4.03.03 (29) |
| 243 |
|
| 244 |
.. index:: AI-0038 (Ada 2012 feature) |
| 245 |
|
| 246 |
* *AI-0038 Minor errors in Text_IO (0000-00-00)* |
| 247 |
|
| 248 |
These are minor errors in the description on three points. The intent on |
| 249 |
all these points has always been clear, and GNAT has always implemented the |
| 250 |
correct intended semantics. |
| 251 |
|
| 252 |
RM References: A.10.05 (37) A.10.07 (8/1) A.10.07 (10) A.10.07 (12) A.10.08 (10) A.10.08 (24) |
| 253 |
|
| 254 |
.. index:: AI-0039 (Ada 2012 feature) |
| 255 |
|
| 256 |
* *AI-0039 Stream attributes cannot be dynamic (0000-00-00)* |
| 257 |
|
| 258 |
The RM permitted the use of dynamic expressions (such as ``ptr.all``) |
| 259 |
for stream attributes, but these were never useful and are now illegal. GNAT |
| 260 |
has always regarded such expressions as illegal. |
| 261 |
|
| 262 |
RM References: 13.03 (4) 13.03 (6) 13.13.02 (38/2) |
| 263 |
|
| 264 |
.. index:: AI-0040 (Ada 2012 feature) |
| 265 |
|
| 266 |
* *AI-0040 Limited with clauses on descendant (0000-00-00)* |
| 267 |
|
| 268 |
This AI confirms that a limited with clause in a child unit cannot name |
| 269 |
an ancestor of the unit. This has always been checked in GNAT. |
| 270 |
|
| 271 |
RM References: 10.01.02 (20/2) |
| 272 |
|
| 273 |
.. index:: AI-0042 (Ada 2012 feature) |
| 274 |
|
| 275 |
* *AI-0042 Overriding versus implemented-by (0000-00-00)* |
| 276 |
|
| 277 |
This AI fixes a wording gap in the RM. An operation of a synchronized |
| 278 |
interface can be implemented by a protected or task entry, but the abstract |
| 279 |
operation is not being overridden in the usual sense, and it must be stated |
| 280 |
separately that this implementation is legal. This has always been the case |
| 281 |
in GNAT. |
| 282 |
|
| 283 |
RM References: 9.01 (9.2/2) 9.04 (11.1/2) |
| 284 |
|
| 285 |
.. index:: AI-0043 (Ada 2012 feature) |
| 286 |
|
| 287 |
* *AI-0043 Rules about raising exceptions (0000-00-00)* |
| 288 |
|
| 289 |
This AI covers various omissions in the RM regarding the raising of |
| 290 |
exceptions. GNAT has always implemented the intended semantics. |
| 291 |
|
| 292 |
RM References: 11.04.01 (10.1/2) 11 (2) |
| 293 |
|
| 294 |
.. index:: AI-0044 (Ada 2012 feature) |
| 295 |
|
| 296 |
* *AI-0044 Restrictions on container instantiations (0000-00-00)* |
| 297 |
|
| 298 |
This AI places restrictions on allowed instantiations of generic containers. |
| 299 |
These restrictions are not checked by the compiler, so there is nothing to |
| 300 |
change in the implementation. This affects only the RM documentation. |
| 301 |
|
| 302 |
RM References: A.18 (4/2) A.18.02 (231/2) A.18.03 (145/2) A.18.06 (56/2) A.18.08 (66/2) A.18.09 (79/2) A.18.26 (5/2) A.18.26 (9/2) |
| 303 |
|
| 304 |
.. index:: AI-0046 (Ada 2012 feature) |
| 305 |
|
| 306 |
* *AI-0046 Null exclusion match for full conformance (2010-07-17)* |
| 307 |
|
| 308 |
For full conformance, in the case of access parameters, the null exclusion |
| 309 |
must match (either both or neither must have ``not null``). |
| 310 |
|
| 311 |
RM References: 6.03.02 (18) |
| 312 |
|
| 313 |
.. index:: AI-0050 (Ada 2012 feature) |
| 314 |
|
| 315 |
* *AI-0050 Raising Constraint_Error early for function call (0000-00-00)* |
| 316 |
|
| 317 |
The implementation permissions for raising ``Constraint_Error`` early on a function call |
| 318 |
when it was clear an exception would be raised were over-permissive and allowed |
| 319 |
mishandling of discriminants in some cases. GNAT did |
| 320 |
not take advantage of these incorrect permissions in any case. |
| 321 |
|
| 322 |
RM References: 6.05 (24/2) |
| 323 |
|
| 324 |
.. index:: AI-0056 (Ada 2012 feature) |
| 325 |
|
| 326 |
* *AI-0056 Index on null string returns zero (0000-00-00)* |
| 327 |
|
| 328 |
The wording in the Ada 2005 RM implied an incompatible handling of the |
| 329 |
``Index`` functions, resulting in raising an exception instead of |
| 330 |
returning zero in some situations. |
| 331 |
This was not intended and has been corrected. |
| 332 |
GNAT always returned zero, and is thus consistent with this AI. |
| 333 |
|
| 334 |
RM References: A.04.03 (56.2/2) A.04.03 (58.5/2) |
| 335 |
|
| 336 |
.. index:: AI-0058 (Ada 2012 feature) |
| 337 |
|
| 338 |
* *AI-0058 Abnormal completion of an extended return (0000-00-00)* |
| 339 |
|
| 340 |
The RM had some incorrect wording implying wrong treatment of abnormal |
| 341 |
completion in an extended return. GNAT has always implemented the intended |
| 342 |
correct semantics as described by this AI. |
| 343 |
|
| 344 |
RM References: 6.05 (22/2) |
| 345 |
|
| 346 |
.. index:: AI-0060 (Ada 2012 feature) |
| 347 |
|
| 348 |
* *AI-0060 Extended definition of remote access types (0000-00-00)* |
| 349 |
|
| 350 |
This AI extends the definition of remote access types to include access |
| 351 |
to limited, synchronized, protected or task class-wide interface types. |
| 352 |
GNAT already implemented this extension. |
| 353 |
|
| 354 |
RM References: A (4) E.02.02 (9/1) E.02.02 (9.2/1) E.02.02 (14/2) E.02.02 (18) |
| 355 |
|
| 356 |
.. index:: AI-0062 (Ada 2012 feature) |
| 357 |
|
| 358 |
* *AI-0062 Null exclusions and deferred constants (0000-00-00)* |
| 359 |
|
| 360 |
A full constant may have a null exclusion even if its associated deferred |
| 361 |
constant does not. GNAT has always allowed this. |
| 362 |
|
| 363 |
RM References: 7.04 (6/2) 7.04 (7.1/2) |
| 364 |
|
| 365 |
.. index:: AI-0064 (Ada 2012 feature) |
| 366 |
|
| 367 |
* *AI-0064 Redundant finalization rule (0000-00-00)* |
| 368 |
|
| 369 |
This is an editorial change only. The intended behavior is already checked |
| 370 |
by an existing ACATS test, which GNAT has always executed correctly. |
| 371 |
|
| 372 |
RM References: 7.06.01 (17.1/1) |
| 373 |
|
| 374 |
.. index:: AI-0065 (Ada 2012 feature) |
| 375 |
|
| 376 |
* *AI-0065 Remote access types and external streaming (0000-00-00)* |
| 377 |
|
| 378 |
This AI clarifies the fact that all remote access types support external |
| 379 |
streaming. This fixes an obvious oversight in the definition of the |
| 380 |
language, and GNAT always implemented the intended correct rules. |
| 381 |
|
| 382 |
RM References: 13.13.02 (52/2) |
| 383 |
|
| 384 |
.. index:: AI-0070 (Ada 2012 feature) |
| 385 |
|
| 386 |
* *AI-0070 Elaboration of interface types (0000-00-00)* |
| 387 |
|
| 388 |
This is an editorial change only, there are no testable consequences short of |
| 389 |
checking for the absence of generated code for an interface declaration. |
| 390 |
|
| 391 |
RM References: 3.09.04 (18/2) |
| 392 |
|
| 393 |
.. index:: AI-0072 (Ada 2012 feature) |
| 394 |
|
| 395 |
* *AI-0072 Task signalling using 'Terminated (0000-00-00)* |
| 396 |
|
| 397 |
This AI clarifies that task signalling for reading ``'Terminated`` only |
| 398 |
occurs if the result is True. GNAT semantics has always been consistent with |
| 399 |
this notion of task signalling. |
| 400 |
|
| 401 |
RM References: 9.10 (6.1/1) |
| 402 |
|
| 403 |
.. index:: AI-0073 (Ada 2012 feature) |
| 404 |
|
| 405 |
* *AI-0073 Functions returning abstract types (2010-07-10)* |
| 406 |
|
| 407 |
This AI covers a number of issues regarding returning abstract types. In |
| 408 |
particular generic functions cannot have abstract result types or access |
| 409 |
result types designated an abstract type. There are some other cases which |
| 410 |
are detailed in the AI. Note that this binding interpretation has not been |
| 411 |
retrofitted to operate before Ada 2012 mode, since it caused a significant |
| 412 |
number of regressions. |
| 413 |
|
| 414 |
RM References: 3.09.03 (8) 3.09.03 (10) 6.05 (8/2) |
| 415 |
|
| 416 |
.. index:: AI-0076 (Ada 2012 feature) |
| 417 |
|
| 418 |
* *AI-0076 function with controlling result (0000-00-00)* |
| 419 |
|
| 420 |
This is an editorial change only. The RM defines calls with controlling |
| 421 |
results, but uses the term 'function with controlling result' without an |
| 422 |
explicit definition. |
| 423 |
|
| 424 |
RM References: 3.09.02 (2/2) |
| 425 |
|
| 426 |
.. index:: AI-0077 (Ada 2012 feature) |
| 427 |
|
| 428 |
* *AI-0077 Limited withs and scope of declarations (0000-00-00)* |
| 429 |
|
| 430 |
This AI clarifies that a declaration does not include a context clause, |
| 431 |
and confirms that it is illegal to have a context in which both a limited |
| 432 |
and a nonlimited view of a package are accessible. Such double visibility |
| 433 |
was always rejected by GNAT. |
| 434 |
|
| 435 |
RM References: 10.01.02 (12/2) 10.01.02 (21/2) 10.01.02 (22/2) |
| 436 |
|
| 437 |
.. index:: AI-0078 (Ada 2012 feature) |
| 438 |
|
| 439 |
* *AI-0078 Relax Unchecked_Conversion alignment rules (0000-00-00)* |
| 440 |
|
| 441 |
In Ada 2012, compilers are required to support unchecked conversion where the |
| 442 |
target alignment is a multiple of the source alignment. GNAT always supported |
| 443 |
this case (and indeed all cases of differing alignments, doing copies where |
| 444 |
required if the alignment was reduced). |
| 445 |
|
| 446 |
RM References: 13.09 (7) |
| 447 |
|
| 448 |
.. index:: AI-0079 (Ada 2012 feature) |
| 449 |
|
| 450 |
* *AI-0079 Allow other_format characters in source (2010-07-10)* |
| 451 |
|
| 452 |
Wide characters in the unicode category *other_format* are now allowed in |
| 453 |
source programs between tokens, but not within a token such as an identifier. |
| 454 |
|
| 455 |
RM References: 2.01 (4/2) 2.02 (7) |
| 456 |
|
| 457 |
.. index:: AI-0080 (Ada 2012 feature) |
| 458 |
|
| 459 |
* *AI-0080 'View of' not needed if clear from context (0000-00-00)* |
| 460 |
|
| 461 |
This is an editorial change only, described as non-testable in the AI. |
| 462 |
|
| 463 |
RM References: 3.01 (7) |
| 464 |
|
| 465 |
.. index:: AI-0087 (Ada 2012 feature) |
| 466 |
|
| 467 |
* *AI-0087 Actual for formal nonlimited derived type (2010-07-15)* |
| 468 |
|
| 469 |
The actual for a formal nonlimited derived type cannot be limited. In |
| 470 |
particular, a formal derived type that extends a limited interface but which |
| 471 |
is not explicitly limited cannot be instantiated with a limited type. |
| 472 |
|
| 473 |
RM References: 7.05 (5/2) 12.05.01 (5.1/2) |
| 474 |
|
| 475 |
.. index:: AI-0088 (Ada 2012 feature) |
| 476 |
|
| 477 |
* *AI-0088 The value of exponentiation (0000-00-00)* |
| 478 |
|
| 479 |
This AI clarifies the equivalence rule given for the dynamic semantics of |
| 480 |
exponentiation: the value of the operation can be obtained by repeated |
| 481 |
multiplication, but the operation can be implemented otherwise (for example |
| 482 |
using the familiar divide-by-two-and-square algorithm, even if this is less |
| 483 |
accurate), and does not imply repeated reads of a volatile base. |
| 484 |
|
| 485 |
RM References: 4.05.06 (11) |
| 486 |
|
| 487 |
.. index:: AI-0091 (Ada 2012 feature) |
| 488 |
|
| 489 |
* *AI-0091 Do not allow other_format in identifiers (0000-00-00)* |
| 490 |
|
| 491 |
Wide characters in the unicode category *other_format* are not permitted |
| 492 |
within an identifier, since this can be a security problem. The error |
| 493 |
message for this case has been improved to be more specific, but GNAT has |
| 494 |
never allowed such characters to appear in identifiers. |
| 495 |
|
| 496 |
RM References: 2.03 (3.1/2) 2.03 (4/2) 2.03 (5/2) 2.03 (5.1/2) 2.03 (5.2/2) 2.03 (5.3/2) 2.09 (2/2) |
| 497 |
|
| 498 |
.. index:: AI-0093 (Ada 2012 feature) |
| 499 |
|
| 500 |
* *AI-0093 Additional rules use immutably limited (0000-00-00)* |
| 501 |
|
| 502 |
This is an editorial change only, to make more widespread use of the Ada 2012 |
| 503 |
'immutably limited'. |
| 504 |
|
| 505 |
RM References: 3.03 (23.4/3) |
| 506 |
|
| 507 |
.. index:: AI-0095 (Ada 2012 feature) |
| 508 |
|
| 509 |
* *AI-0095 Address of intrinsic subprograms (0000-00-00)* |
| 510 |
|
| 511 |
The prefix of ``'Address`` cannot statically denote a subprogram with |
| 512 |
convention ``Intrinsic``. The use of the ``Address`` attribute raises |
| 513 |
``Program_Error`` if the prefix denotes a subprogram with convention |
| 514 |
``Intrinsic``. |
| 515 |
|
| 516 |
RM References: 13.03 (11/1) |
| 517 |
|
| 518 |
.. index:: AI-0096 (Ada 2012 feature) |
| 519 |
|
| 520 |
* *AI-0096 Deriving from formal private types (2010-07-20)* |
| 521 |
|
| 522 |
In general it is illegal for a type derived from a formal limited type to be |
| 523 |
nonlimited. This AI makes an exception to this rule: derivation is legal |
| 524 |
if it appears in the private part of the generic, and the formal type is not |
| 525 |
tagged. If the type is tagged, the legality check must be applied to the |
| 526 |
private part of the package. |
| 527 |
|
| 528 |
RM References: 3.04 (5.1/2) 6.02 (7) |
| 529 |
|
| 530 |
.. index:: AI-0097 (Ada 2012 feature) |
| 531 |
|
| 532 |
* *AI-0097 Treatment of abstract null extension (2010-07-19)* |
| 533 |
|
| 534 |
The RM as written implied that in some cases it was possible to create an |
| 535 |
object of an abstract type, by having an abstract extension inherit a non- |
| 536 |
abstract constructor from its parent type. This mistake has been corrected |
| 537 |
in GNAT and in the RM, and this construct is now illegal. |
| 538 |
|
| 539 |
RM References: 3.09.03 (4/2) |
| 540 |
|
| 541 |
.. index:: AI-0098 (Ada 2012 feature) |
| 542 |
|
| 543 |
* *AI-0098 Anonymous subprogram access restrictions (0000-00-00)* |
| 544 |
|
| 545 |
An unintentional omission in the RM implied some inconsistent restrictions on |
| 546 |
the use of anonymous access to subprogram values. These restrictions were not |
| 547 |
intentional, and have never been enforced by GNAT. |
| 548 |
|
| 549 |
RM References: 3.10.01 (6) 3.10.01 (9.2/2) |
| 550 |
|
| 551 |
.. index:: AI-0099 (Ada 2012 feature) |
| 552 |
|
| 553 |
* *AI-0099 Tag determines whether finalization needed (0000-00-00)* |
| 554 |
|
| 555 |
This AI clarifies that 'needs finalization' is part of dynamic semantics, |
| 556 |
and therefore depends on the run-time characteristics of an object (i.e. its |
| 557 |
tag) and not on its nominal type. As the AI indicates: "we do not expect |
| 558 |
this to affect any implementation". |
| 559 |
|
| 560 |
RM References: 7.06.01 (6) 7.06.01 (7) 7.06.01 (8) 7.06.01 (9/2) |
| 561 |
|
| 562 |
.. index:: AI-0100 (Ada 2012 feature) |
| 563 |
|
| 564 |
* *AI-0100 Placement of pragmas (2010-07-01)* |
| 565 |
|
| 566 |
This AI is an earlier version of AI-163. It simplifies the rules |
| 567 |
for legal placement of pragmas. In the case of lists that allow pragmas, if |
| 568 |
the list may have no elements, then the list may consist solely of pragmas. |
| 569 |
|
| 570 |
RM References: 2.08 (7) |
| 571 |
|
| 572 |
.. index:: AI-0102 (Ada 2012 feature) |
| 573 |
|
| 574 |
* *AI-0102 Some implicit conversions are illegal (0000-00-00)* |
| 575 |
|
| 576 |
It is illegal to assign an anonymous access constant to an anonymous access |
| 577 |
variable. The RM did not have a clear rule to prevent this, but GNAT has |
| 578 |
always generated an error for this usage. |
| 579 |
|
| 580 |
RM References: 3.07 (16) 3.07.01 (9) 6.04.01 (6) 8.06 (27/2) |
| 581 |
|
| 582 |
.. index:: AI-0103 (Ada 2012 feature) |
| 583 |
|
| 584 |
* *AI-0103 Static matching for extended return (2010-07-23)* |
| 585 |
|
| 586 |
If the return subtype of a function is an elementary type or a constrained |
| 587 |
type, the subtype indication in an extended return statement must match |
| 588 |
statically this return subtype. |
| 589 |
|
| 590 |
RM References: 6.05 (5.2/2) |
| 591 |
|
| 592 |
.. index:: AI-0104 (Ada 2012 feature) |
| 593 |
|
| 594 |
* *AI-0104 Null exclusion and uninitialized allocator (2010-07-15)* |
| 595 |
|
| 596 |
The assignment ``Ptr := new not null Some_Ptr;`` will raise |
| 597 |
``Constraint_Error`` because the default value of the allocated object is |
| 598 |
**null**. This useless construct is illegal in Ada 2012. |
| 599 |
|
| 600 |
RM References: 4.08 (2) |
| 601 |
|
| 602 |
.. index:: AI-0106 (Ada 2012 feature) |
| 603 |
|
| 604 |
* *AI-0106 No representation pragmas on generic formals (0000-00-00)* |
| 605 |
|
| 606 |
The RM appeared to allow representation pragmas on generic formal parameters, |
| 607 |
but this was not intended, and GNAT has never permitted this usage. |
| 608 |
|
| 609 |
RM References: 13.01 (9.1/1) |
| 610 |
|
| 611 |
.. index:: AI-0108 (Ada 2012 feature) |
| 612 |
|
| 613 |
* *AI-0108 Limited incomplete view and discriminants (0000-00-00)* |
| 614 |
|
| 615 |
This AI confirms that an incomplete type from a limited view does not have |
| 616 |
discriminants. This has always been the case in GNAT. |
| 617 |
|
| 618 |
RM References: 10.01.01 (12.3/2) |
| 619 |
|
| 620 |
.. index:: AI-0109 (Ada 2012 feature) |
| 621 |
|
| 622 |
* *AI-0109 Redundant check in S'Class'Input (0000-00-00)* |
| 623 |
|
| 624 |
This AI is an editorial change only. It removes the need for a tag check |
| 625 |
that can never fail. |
| 626 |
|
| 627 |
RM References: 13.13.02 (34/2) |
| 628 |
|
| 629 |
.. index:: AI-0112 (Ada 2012 feature) |
| 630 |
|
| 631 |
* *AI-0112 Detection of duplicate pragmas (2010-07-24)* |
| 632 |
|
| 633 |
This AI concerns giving names to various representation aspects, but the |
| 634 |
practical effect is simply to make the use of duplicate |
| 635 |
``Atomic[_Components]``, |
| 636 |
``Volatile[_Components]``, and |
| 637 |
``Independent[_Components]`` pragmas illegal, and GNAT |
| 638 |
now performs this required check. |
| 639 |
|
| 640 |
RM References: 13.01 (8) |
| 641 |
|
| 642 |
.. index:: AI-0114 (Ada 2012 feature) |
| 643 |
|
| 644 |
* *AI-0114 Classification of letters (0000-00-00)* |
| 645 |
|
| 646 |
The code points 170 (``FEMININE ORDINAL INDICATOR``), |
| 647 |
181 (``MICRO SIGN``), and |
| 648 |
186 (``MASCULINE ORDINAL INDICATOR``) are technically considered |
| 649 |
lower case letters by Unicode. |
| 650 |
However, they are not allowed in identifiers, and they |
| 651 |
return ``False`` to ``Ada.Characters.Handling.Is_Letter/Is_Lower``. |
| 652 |
This behavior is consistent with that defined in Ada 95. |
| 653 |
|
| 654 |
RM References: A.03.02 (59) A.04.06 (7) |
| 655 |
|
| 656 |
.. index:: AI-0116 (Ada 2012 feature) |
| 657 |
|
| 658 |
* *AI-0116 Alignment of class-wide objects (0000-00-00)* |
| 659 |
|
| 660 |
This AI requires that the alignment of a class-wide object be no greater |
| 661 |
than the alignment of any type in the class. GNAT has always followed this |
| 662 |
recommendation. |
| 663 |
|
| 664 |
RM References: 13.03 (29) 13.11 (16) |
| 665 |
|
| 666 |
.. index:: AI-0118 (Ada 2012 feature) |
| 667 |
|
| 668 |
* *AI-0118 The association of parameter associations (0000-00-00)* |
| 669 |
|
| 670 |
This AI clarifies the rules for named associations in subprogram calls and |
| 671 |
generic instantiations. The rules have been in place since Ada 83. |
| 672 |
|
| 673 |
RM References: 6.04.01 (2) 12.03 (9) |
| 674 |
|
| 675 |
.. index:: AI-0120 (Ada 2012 feature) |
| 676 |
|
| 677 |
* *AI-0120 Constant instance of protected object (0000-00-00)* |
| 678 |
|
| 679 |
This is an RM editorial change only. The section that lists objects that are |
| 680 |
constant failed to include the current instance of a protected object |
| 681 |
within a protected function. This has always been treated as a constant |
| 682 |
in GNAT. |
| 683 |
|
| 684 |
RM References: 3.03 (21) |
| 685 |
|
| 686 |
.. index:: AI-0122 (Ada 2012 feature) |
| 687 |
|
| 688 |
* *AI-0122 Private with and children of generics (0000-00-00)* |
| 689 |
|
| 690 |
This AI clarifies the visibility of private children of generic units within |
| 691 |
instantiations of a parent. GNAT has always handled this correctly. |
| 692 |
|
| 693 |
RM References: 10.01.02 (12/2) |
| 694 |
|
| 695 |
.. index:: AI-0123 (Ada 2012 feature) |
| 696 |
|
| 697 |
* *AI-0123 Composability of equality (2010-04-13)* |
| 698 |
|
| 699 |
Equality of untagged record composes, so that the predefined equality for a |
| 700 |
composite type that includes a component of some untagged record type |
| 701 |
``R`` uses the equality operation of ``R`` (which may be user-defined |
| 702 |
or predefined). This makes the behavior of untagged records identical to that |
| 703 |
of tagged types in this respect. |
| 704 |
|
| 705 |
This change is an incompatibility with previous versions of Ada, but it |
| 706 |
corrects a non-uniformity that was often a source of confusion. Analysis of |
| 707 |
a large number of industrial programs indicates that in those rare cases |
| 708 |
where a composite type had an untagged record component with a user-defined |
| 709 |
equality, either there was no use of the composite equality, or else the code |
| 710 |
expected the same composability as for tagged types, and thus had a bug that |
| 711 |
would be fixed by this change. |
| 712 |
|
| 713 |
RM References: 4.05.02 (9.7/2) 4.05.02 (14) 4.05.02 (15) 4.05.02 (24) |
| 714 |
8.05.04 (8) |
| 715 |
|
| 716 |
.. index:: AI-0125 (Ada 2012 feature) |
| 717 |
|
| 718 |
* *AI-0125 Nonoverridable operations of an ancestor (2010-09-28)* |
| 719 |
|
| 720 |
In Ada 2012, the declaration of a primitive operation of a type extension |
| 721 |
or private extension can also override an inherited primitive that is not |
| 722 |
visible at the point of this declaration. |
| 723 |
|
| 724 |
RM References: 7.03.01 (6) 8.03 (23) 8.03.01 (5/2) 8.03.01 (6/2) |
| 725 |
|
| 726 |
.. index:: AI-0126 (Ada 2012 feature) |
| 727 |
|
| 728 |
* *AI-0126 Dispatching with no declared operation (0000-00-00)* |
| 729 |
|
| 730 |
This AI clarifies dispatching rules, and simply confirms that dispatching |
| 731 |
executes the operation of the parent type when there is no explicitly or |
| 732 |
implicitly declared operation for the descendant type. This has always been |
| 733 |
the case in all versions of GNAT. |
| 734 |
|
| 735 |
RM References: 3.09.02 (20/2) 3.09.02 (20.1/2) 3.09.02 (20.2/2) |
| 736 |
|
| 737 |
.. index:: AI-0127 (Ada 2012 feature) |
| 738 |
|
| 739 |
* *AI-0127 Adding Locale Capabilities (2010-09-29)* |
| 740 |
|
| 741 |
This package provides an interface for identifying the current locale. |
| 742 |
|
| 743 |
RM References: A.19 A.19.01 A.19.02 A.19.03 A.19.05 A.19.06 |
| 744 |
A.19.07 A.19.08 A.19.09 A.19.10 A.19.11 A.19.12 A.19.13 |
| 745 |
|
| 746 |
.. index:: AI-0128 (Ada 2012 feature) |
| 747 |
|
| 748 |
* *AI-0128 Inequality is a primitive operation (0000-00-00)* |
| 749 |
|
| 750 |
If an equality operator ("=") is declared for a type, then the implicitly |
| 751 |
declared inequality operator ("/=") is a primitive operation of the type. |
| 752 |
This is the only reasonable interpretation, and is the one always implemented |
| 753 |
by GNAT, but the RM was not entirely clear in making this point. |
| 754 |
|
| 755 |
RM References: 3.02.03 (6) 6.06 (6) |
| 756 |
|
| 757 |
.. index:: AI-0129 (Ada 2012 feature) |
| 758 |
|
| 759 |
* *AI-0129 Limited views and incomplete types (0000-00-00)* |
| 760 |
|
| 761 |
This AI clarifies the description of limited views: a limited view of a |
| 762 |
package includes only one view of a type that has an incomplete declaration |
| 763 |
and a full declaration (there is no possible ambiguity in a client package). |
| 764 |
This AI also fixes an omission: a nested package in the private part has no |
| 765 |
limited view. GNAT always implemented this correctly. |
| 766 |
|
| 767 |
RM References: 10.01.01 (12.2/2) 10.01.01 (12.3/2) |
| 768 |
|
| 769 |
.. index:: AI-0132 (Ada 2012 feature) |
| 770 |
|
| 771 |
* *AI-0132 Placement of library unit pragmas (0000-00-00)* |
| 772 |
|
| 773 |
This AI fills a gap in the description of library unit pragmas. The pragma |
| 774 |
clearly must apply to a library unit, even if it does not carry the name |
| 775 |
of the enclosing unit. GNAT has always enforced the required check. |
| 776 |
|
| 777 |
RM References: 10.01.05 (7) |
| 778 |
|
| 779 |
.. index:: AI-0134 (Ada 2012 feature) |
| 780 |
|
| 781 |
* *AI-0134 Profiles must match for full conformance (0000-00-00)* |
| 782 |
|
| 783 |
For full conformance, the profiles of anonymous-access-to-subprogram |
| 784 |
parameters must match. GNAT has always enforced this rule. |
| 785 |
|
| 786 |
RM References: 6.03.01 (18) |
| 787 |
|
| 788 |
.. index:: AI-0137 (Ada 2012 feature) |
| 789 |
|
| 790 |
* *AI-0137 String encoding package (2010-03-25)* |
| 791 |
|
| 792 |
The packages ``Ada.Strings.UTF_Encoding``, together with its child |
| 793 |
packages, ``Conversions``, ``Strings``, ``Wide_Strings``, |
| 794 |
and ``Wide_Wide_Strings`` have been |
| 795 |
implemented. These packages (whose documentation can be found in the spec |
| 796 |
files :file:`a-stuten.ads`, :file:`a-suenco.ads`, :file:`a-suenst.ads`, |
| 797 |
:file:`a-suewst.ads`, :file:`a-suezst.ads`) allow encoding and decoding of |
| 798 |
``String``, ``Wide_String``, and ``Wide_Wide_String`` |
| 799 |
values using UTF coding schemes (including UTF-8, UTF-16LE, UTF-16BE, and |
| 800 |
UTF-16), as well as conversions between the different UTF encodings. With |
| 801 |
the exception of ``Wide_Wide_Strings``, these packages are available in |
| 802 |
Ada 95 and Ada 2005 mode as well as Ada 2012 mode. |
| 803 |
The ``Wide_Wide_Strings`` package |
| 804 |
is available in Ada 2005 mode as well as Ada 2012 mode (but not in Ada 95 |
| 805 |
mode since it uses ``Wide_Wide_Character``). |
| 806 |
|
| 807 |
RM References: A.04.11 |
| 808 |
|
| 809 |
.. index:: AI-0139-2 (Ada 2012 feature) |
| 810 |
|
| 811 |
* *AI-0139-2 Syntactic sugar for iterators (2010-09-29)* |
| 812 |
|
| 813 |
The new syntax for iterating over arrays and containers is now implemented. |
| 814 |
Iteration over containers is for now limited to read-only iterators. Only |
| 815 |
default iterators are supported, with the syntax: ``for Elem of C``. |
| 816 |
|
| 817 |
RM References: 5.05 |
| 818 |
|
| 819 |
.. index:: AI-0146 (Ada 2012 feature) |
| 820 |
|
| 821 |
* *AI-0146 Type invariants (2009-09-21)* |
| 822 |
|
| 823 |
Type invariants may be specified for private types using the aspect notation. |
| 824 |
Aspect ``Type_Invariant`` may be specified for any private type, |
| 825 |
``Type_Invariant'Class`` can |
| 826 |
only be specified for tagged types, and is inherited by any descendent of the |
| 827 |
tagged types. The invariant is a boolean expression that is tested for being |
| 828 |
true in the following situations: conversions to the private type, object |
| 829 |
declarations for the private type that are default initialized, and |
| 830 |
[**in**] **out** |
| 831 |
parameters and returned result on return from any primitive operation for |
| 832 |
the type that is visible to a client. |
| 833 |
GNAT defines the synonyms ``Invariant`` for ``Type_Invariant`` and |
| 834 |
``Invariant'Class`` for ``Type_Invariant'Class``. |
| 835 |
|
| 836 |
RM References: 13.03.03 (00) |
| 837 |
|
| 838 |
.. index:: AI-0147 (Ada 2012 feature) |
| 839 |
|
| 840 |
* *AI-0147 Conditional expressions (2009-03-29)* |
| 841 |
|
| 842 |
Conditional expressions are permitted. The form of such an expression is: |
| 843 |
|
| 844 |
:: |
| 845 |
|
| 846 |
(if expr then expr {elsif expr then expr} [else expr]) |
| 847 |
|
| 848 |
The parentheses can be omitted in contexts where parentheses are present |
| 849 |
anyway, such as subprogram arguments and pragma arguments. If the **else** |
| 850 |
clause is omitted, **else** *True* is assumed; |
| 851 |
thus ``(if A then B)`` is a way to conveniently represent |
| 852 |
*(A implies B)* in standard logic. |
| 853 |
|
| 854 |
RM References: 4.03.03 (15) 4.04 (1) 4.04 (7) 4.05.07 (0) 4.07 (2) |
| 855 |
4.07 (3) 4.09 (12) 4.09 (33) 5.03 (3) 5.03 (4) 7.05 (2.1/2) |
| 856 |
|
| 857 |
.. index:: AI-0152 (Ada 2012 feature) |
| 858 |
|
| 859 |
* *AI-0152 Restriction No_Anonymous_Allocators (2010-09-08)* |
| 860 |
|
| 861 |
Restriction ``No_Anonymous_Allocators`` prevents the use of allocators |
| 862 |
where the type of the returned value is an anonymous access type. |
| 863 |
|
| 864 |
RM References: H.04 (8/1) |
| 865 |
|
| 866 |
.. index:: AI-0157 (Ada 2012 feature) |
| 867 |
|
| 868 |
* *AI-0157 Allocation/Deallocation from empty pool (2010-07-11)* |
| 869 |
|
| 870 |
Allocation and Deallocation from an empty storage pool (i.e. allocation or |
| 871 |
deallocation of a pointer for which a static storage size clause of zero |
| 872 |
has been given) is now illegal and is detected as such. GNAT |
| 873 |
previously gave a warning but not an error. |
| 874 |
|
| 875 |
RM References: 4.08 (5.3/2) 13.11.02 (4) 13.11.02 (17) |
| 876 |
|
| 877 |
.. index:: AI-0158 (Ada 2012 feature) |
| 878 |
|
| 879 |
* *AI-0158 Generalizing membership tests (2010-09-16)* |
| 880 |
|
| 881 |
This AI extends the syntax of membership tests to simplify complex conditions |
| 882 |
that can be expressed as membership in a subset of values of any type. It |
| 883 |
introduces syntax for a list of expressions that may be used in loop contexts |
| 884 |
as well. |
| 885 |
|
| 886 |
RM References: 3.08.01 (5) 4.04 (3) 4.05.02 (3) 4.05.02 (5) 4.05.02 (27) |
| 887 |
|
| 888 |
.. index:: AI-0161 (Ada 2012 feature) |
| 889 |
|
| 890 |
* *AI-0161 Restriction No_Default_Stream_Attributes (2010-09-11)* |
| 891 |
|
| 892 |
A new restriction ``No_Default_Stream_Attributes`` prevents the use of any |
| 893 |
of the default stream attributes for elementary types. If this restriction is |
| 894 |
in force, then it is necessary to provide explicit subprograms for any |
| 895 |
stream attributes used. |
| 896 |
|
| 897 |
RM References: 13.12.01 (4/2) 13.13.02 (40/2) 13.13.02 (52/2) |
| 898 |
|
| 899 |
.. index:: AI-0162 (Ada 2012 feature) |
| 900 |
|
| 901 |
* *AI-0162 Incomplete type completed by partial view (2010-09-15)* |
| 902 |
|
| 903 |
Incomplete types are made more useful by allowing them to be completed by |
| 904 |
private types and private extensions. |
| 905 |
|
| 906 |
RM References: 3.10.01 (2.5/2) 3.10.01 (2.6/2) 3.10.01 (3) 3.10.01 (4/2) |
| 907 |
|
| 908 |
.. index:: AI-0163 (Ada 2012 feature) |
| 909 |
|
| 910 |
* *AI-0163 Pragmas in place of null (2010-07-01)* |
| 911 |
|
| 912 |
A statement sequence may be composed entirely of pragmas. It is no longer |
| 913 |
necessary to add a dummy ``null`` statement to make the sequence legal. |
| 914 |
|
| 915 |
RM References: 2.08 (7) 2.08 (16) |
| 916 |
|
| 917 |
.. index:: AI-0171 (Ada 2012 feature) |
| 918 |
|
| 919 |
* *AI-0171 Pragma CPU and Ravenscar Profile (2010-09-24)* |
| 920 |
|
| 921 |
A new package ``System.Multiprocessors`` is added, together with the |
| 922 |
definition of pragma ``CPU`` for controlling task affinity. A new no |
| 923 |
dependence restriction, on ``System.Multiprocessors.Dispatching_Domains``, |
| 924 |
is added to the Ravenscar profile. |
| 925 |
|
| 926 |
RM References: D.13.01 (4/2) D.16 |
| 927 |
|
| 928 |
.. index:: AI-0173 (Ada 2012 feature) |
| 929 |
|
| 930 |
* *AI-0173 Testing if tags represent abstract types (2010-07-03)* |
| 931 |
|
| 932 |
The function ``Ada.Tags.Type_Is_Abstract`` returns ``True`` if invoked |
| 933 |
with the tag of an abstract type, and ``False`` otherwise. |
| 934 |
|
| 935 |
RM References: 3.09 (7.4/2) 3.09 (12.4/2) |
| 936 |
|
| 937 |
.. index:: AI-0176 (Ada 2012 feature) |
| 938 |
|
| 939 |
* *AI-0176 Quantified expressions (2010-09-29)* |
| 940 |
|
| 941 |
Both universally and existentially quantified expressions are implemented. |
| 942 |
They use the new syntax for iterators proposed in AI05-139-2, as well as |
| 943 |
the standard Ada loop syntax. |
| 944 |
|
| 945 |
RM References: 1.01.04 (12) 2.09 (2/2) 4.04 (7) 4.05.09 (0) |
| 946 |
|
| 947 |
.. index:: AI-0177 (Ada 2012 feature) |
| 948 |
|
| 949 |
* *AI-0177 Parameterized expressions (2010-07-10)* |
| 950 |
|
| 951 |
The new Ada 2012 notion of parameterized expressions is implemented. The form |
| 952 |
is: |
| 953 |
|
| 954 |
.. code-block:: ada |
| 955 |
|
| 956 |
function-specification is (expression) |
| 957 |
|
| 958 |
This is exactly equivalent to the |
| 959 |
corresponding function body that returns the expression, but it can appear |
| 960 |
in a package spec. Note that the expression must be parenthesized. |
| 961 |
|
| 962 |
RM References: 13.11.01 (3/2) |
| 963 |
|
| 964 |
.. index:: AI-0178 (Ada 2012 feature) |
| 965 |
|
| 966 |
* *AI-0178 Incomplete views are limited (0000-00-00)* |
| 967 |
|
| 968 |
This AI clarifies the role of incomplete views and plugs an omission in the |
| 969 |
RM. GNAT always correctly restricted the use of incomplete views and types. |
| 970 |
|
| 971 |
RM References: 7.05 (3/2) 7.05 (6/2) |
| 972 |
|
| 973 |
.. index:: AI-0179 (Ada 2012 feature) |
| 974 |
|
| 975 |
* *AI-0179 Statement not required after label (2010-04-10)* |
| 976 |
|
| 977 |
It is not necessary to have a statement following a label, so a label |
| 978 |
can appear at the end of a statement sequence without the need for putting a |
| 979 |
null statement afterwards, but it is not allowable to have only labels and |
| 980 |
no real statements in a statement sequence. |
| 981 |
|
| 982 |
RM References: 5.01 (2) |
| 983 |
|
| 984 |
.. index:: AI-0181 (Ada 2012 feature) |
| 985 |
|
| 986 |
* *AI-0181 Soft hyphen is a non-graphic character (2010-07-23)* |
| 987 |
|
| 988 |
From Ada 2005 on, soft hyphen is considered a non-graphic character, which |
| 989 |
means that it has a special name (``SOFT_HYPHEN``) in conjunction with the |
| 990 |
``Image`` and ``Value`` attributes for the character types. Strictly |
| 991 |
speaking this is an inconsistency with Ada 95, but in practice the use of |
| 992 |
these attributes is so obscure that it will not cause problems. |
| 993 |
|
| 994 |
RM References: 3.05.02 (2/2) A.01 (35/2) A.03.03 (21) |
| 995 |
|
| 996 |
.. index:: AI-0182 (Ada 2012 feature) |
| 997 |
|
| 998 |
* *AI-0182 Additional forms for* ``Character'Value`` *(0000-00-00)* |
| 999 |
|
| 1000 |
This AI allows ``Character'Value`` to accept the string ``'?'`` where |
| 1001 |
``?`` is any character including non-graphic control characters. GNAT has |
| 1002 |
always accepted such strings. It also allows strings such as |
| 1003 |
``HEX_00000041`` to be accepted, but GNAT does not take advantage of this |
| 1004 |
permission and raises ``Constraint_Error``, as is certainly still |
| 1005 |
permitted. |
| 1006 |
|
| 1007 |
RM References: 3.05 (56/2) |
| 1008 |
|
| 1009 |
.. index:: AI-0183 (Ada 2012 feature) |
| 1010 |
|
| 1011 |
* *AI-0183 Aspect specifications (2010-08-16)* |
| 1012 |
|
| 1013 |
Aspect specifications have been fully implemented except for pre and post- |
| 1014 |
conditions, and type invariants, which have their own separate AI's. All |
| 1015 |
forms of declarations listed in the AI are supported. The following is a |
| 1016 |
list of the aspects supported (with GNAT implementation aspects marked) |
| 1017 |
|
| 1018 |
==================================== =========== |
| 1019 |
Supported Aspect Source |
| 1020 |
==================================== =========== |
| 1021 |
``Ada_2005`` -- GNAT |
| 1022 |
``Ada_2012`` -- GNAT |
| 1023 |
``Address`` |
| 1024 |
``Alignment`` |
| 1025 |
``Atomic`` |
| 1026 |
``Atomic_Components`` |
| 1027 |
``Bit_Order`` |
| 1028 |
``Component_Size`` |
| 1029 |
``Contract_Cases`` -- GNAT |
| 1030 |
``Discard_Names`` |
| 1031 |
``External_Tag`` |
| 1032 |
``Favor_Top_Level`` -- GNAT |
| 1033 |
``Inline`` |
| 1034 |
``Inline_Always`` -- GNAT |
| 1035 |
``Invariant`` -- GNAT |
| 1036 |
``Machine_Radix`` |
| 1037 |
``No_Return`` |
| 1038 |
``Object_Size`` -- GNAT |
| 1039 |
``Pack`` |
| 1040 |
``Persistent_BSS`` -- GNAT |
| 1041 |
``Post`` |
| 1042 |
``Pre`` |
| 1043 |
``Predicate`` |
| 1044 |
``Preelaborable_Initialization`` |
| 1045 |
``Pure_Function`` -- GNAT |
| 1046 |
``Remote_Access_Type`` -- GNAT |
| 1047 |
``Shared`` -- GNAT |
| 1048 |
``Size`` |
| 1049 |
``Storage_Pool`` |
| 1050 |
``Storage_Size`` |
| 1051 |
``Stream_Size`` |
| 1052 |
``Suppress`` |
| 1053 |
``Suppress_Debug_Info`` -- GNAT |
| 1054 |
``Test_Case`` -- GNAT |
| 1055 |
``Thread_Local_Storage`` -- GNAT |
| 1056 |
``Type_Invariant`` |
| 1057 |
``Unchecked_Union`` |
| 1058 |
``Universal_Aliasing`` -- GNAT |
| 1059 |
``Unmodified`` -- GNAT |
| 1060 |
``Unreferenced`` -- GNAT |
| 1061 |
``Unreferenced_Objects`` -- GNAT |
| 1062 |
``Unsuppress`` |
| 1063 |
``Value_Size`` -- GNAT |
| 1064 |
``Volatile`` |
| 1065 |
``Volatile_Components`` |
| 1066 |
``Warnings`` -- GNAT |
| 1067 |
==================================== =========== |
| 1068 |
|
| 1069 |
Note that for aspects with an expression, e.g. ``Size``, the expression is |
| 1070 |
treated like a default expression (visibility is analyzed at the point of |
| 1071 |
occurrence of the aspect, but evaluation of the expression occurs at the |
| 1072 |
freeze point of the entity involved). |
| 1073 |
|
| 1074 |
RM References: 3.02.01 (3) 3.02.02 (2) 3.03.01 (2/2) 3.08 (6) |
| 1075 |
3.09.03 (1.1/2) 6.01 (2/2) 6.07 (2/2) 9.05.02 (2/2) 7.01 (3) 7.03 |
| 1076 |
(2) 7.03 (3) 9.01 (2/2) 9.01 (3/2) 9.04 (2/2) 9.04 (3/2) |
| 1077 |
9.05.02 (2/2) 11.01 (2) 12.01 (3) 12.03 (2/2) 12.04 (2/2) 12.05 (2) |
| 1078 |
12.06 (2.1/2) 12.06 (2.2/2) 12.07 (2) 13.01 (0.1/2) 13.03 (5/1) |
| 1079 |
13.03.01 (0) |
| 1080 |
|
| 1081 |
.. index:: AI-0185 (Ada 2012 feature) |
| 1082 |
|
| 1083 |
* *AI-0185 Ada.Wide_[Wide_]Characters.Handling (2010-07-06)* |
| 1084 |
|
| 1085 |
Two new packages ``Ada.Wide_[Wide_]Characters.Handling`` provide |
| 1086 |
classification functions for ``Wide_Character`` and |
| 1087 |
``Wide_Wide_Character``, as well as providing |
| 1088 |
case folding routines for ``Wide_[Wide_]Character`` and |
| 1089 |
``Wide_[Wide_]String``. |
| 1090 |
|
| 1091 |
RM References: A.03.05 (0) A.03.06 (0) |
| 1092 |
|
| 1093 |
.. index:: AI-0188 (Ada 2012 feature) |
| 1094 |
|
| 1095 |
* *AI-0188 Case expressions (2010-01-09)* |
| 1096 |
|
| 1097 |
Case expressions are permitted. This allows use of constructs such as: |
| 1098 |
|
| 1099 |
.. code-block:: ada |
| 1100 |
|
| 1101 |
X := (case Y is when 1 => 2, when 2 => 3, when others => 31) |
| 1102 |
|
| 1103 |
RM References: 4.05.07 (0) 4.05.08 (0) 4.09 (12) 4.09 (33) |
| 1104 |
|
| 1105 |
.. index:: AI-0189 (Ada 2012 feature) |
| 1106 |
|
| 1107 |
* *AI-0189 No_Allocators_After_Elaboration (2010-01-23)* |
| 1108 |
|
| 1109 |
This AI introduces a new restriction ``No_Allocators_After_Elaboration``, |
| 1110 |
which says that no dynamic allocation will occur once elaboration is |
| 1111 |
completed. |
| 1112 |
In general this requires a run-time check, which is not required, and which |
| 1113 |
GNAT does not attempt. But the static cases of allocators in a task body or |
| 1114 |
in the body of the main program are detected and flagged at compile or bind |
| 1115 |
time. |
| 1116 |
|
| 1117 |
RM References: D.07 (19.1/2) H.04 (23.3/2) |
| 1118 |
|
| 1119 |
.. index:: AI-0190 (Ada 2012 feature) |
| 1120 |
|
| 1121 |
* *AI-0190 pragma Default_Storage_Pool (2010-09-15)* |
| 1122 |
|
| 1123 |
This AI introduces a new pragma ``Default_Storage_Pool``, which can be |
| 1124 |
used to control storage pools globally. |
| 1125 |
In particular, you can force every access |
| 1126 |
type that is used for allocation (**new**) to have an explicit storage pool, |
| 1127 |
or you can declare a pool globally to be used for all access types that lack |
| 1128 |
an explicit one. |
| 1129 |
|
| 1130 |
RM References: D.07 (8) |
| 1131 |
|
| 1132 |
.. index:: AI-0193 (Ada 2012 feature) |
| 1133 |
|
| 1134 |
* *AI-0193 Alignment of allocators (2010-09-16)* |
| 1135 |
|
| 1136 |
This AI introduces a new attribute ``Max_Alignment_For_Allocation``, |
| 1137 |
analogous to ``Max_Size_In_Storage_Elements``, but for alignment instead |
| 1138 |
of size. |
| 1139 |
|
| 1140 |
RM References: 13.11 (16) 13.11 (21) 13.11.01 (0) 13.11.01 (1) |
| 1141 |
13.11.01 (2) 13.11.01 (3) |
| 1142 |
|
| 1143 |
.. index:: AI-0194 (Ada 2012 feature) |
| 1144 |
|
| 1145 |
* *AI-0194 Value of Stream_Size attribute (0000-00-00)* |
| 1146 |
|
| 1147 |
The ``Stream_Size`` attribute returns the default number of bits in the |
| 1148 |
stream representation of the given type. |
| 1149 |
This value is not affected by the presence |
| 1150 |
of stream subprogram attributes for the type. GNAT has always implemented |
| 1151 |
this interpretation. |
| 1152 |
|
| 1153 |
RM References: 13.13.02 (1.2/2) |
| 1154 |
|
| 1155 |
.. index:: AI-0195 (Ada 2012 feature) |
| 1156 |
|
| 1157 |
* *AI-0195 Invalid value handling is implementation defined (2010-07-03)* |
| 1158 |
|
| 1159 |
The handling of invalid values is now designated to be implementation |
| 1160 |
defined. This is a documentation change only, requiring Annex M in the GNAT |
| 1161 |
Reference Manual to document this handling. |
| 1162 |
In GNAT, checks for invalid values are made |
| 1163 |
only when necessary to avoid erroneous behavior. Operations like assignments |
| 1164 |
which cannot cause erroneous behavior ignore the possibility of invalid |
| 1165 |
values and do not do a check. The date given above applies only to the |
| 1166 |
documentation change, this behavior has always been implemented by GNAT. |
| 1167 |
|
| 1168 |
RM References: 13.09.01 (10) |
| 1169 |
|
| 1170 |
.. index:: AI-0196 (Ada 2012 feature) |
| 1171 |
|
| 1172 |
* *AI-0196 Null exclusion tests for out parameters (0000-00-00)* |
| 1173 |
|
| 1174 |
Null exclusion checks are not made for ``out`` parameters when |
| 1175 |
evaluating the actual parameters. GNAT has never generated these checks. |
| 1176 |
|
| 1177 |
RM References: 6.04.01 (13) |
| 1178 |
|
| 1179 |
.. index:: AI-0198 (Ada 2012 feature) |
| 1180 |
|
| 1181 |
* *AI-0198 Inheriting abstract operators (0000-00-00)* |
| 1182 |
|
| 1183 |
This AI resolves a conflict between two rules involving inherited abstract |
| 1184 |
operations and predefined operators. If a derived numeric type inherits |
| 1185 |
an abstract operator, it overrides the predefined one. This interpretation |
| 1186 |
was always the one implemented in GNAT. |
| 1187 |
|
| 1188 |
RM References: 3.09.03 (4/3) |
| 1189 |
|
| 1190 |
.. index:: AI-0199 (Ada 2012 feature) |
| 1191 |
|
| 1192 |
* *AI-0199 Aggregate with anonymous access components (2010-07-14)* |
| 1193 |
|
| 1194 |
A choice list in a record aggregate can include several components of |
| 1195 |
(distinct) anonymous access types as long as they have matching designated |
| 1196 |
subtypes. |
| 1197 |
|
| 1198 |
RM References: 4.03.01 (16) |
| 1199 |
|
| 1200 |
.. index:: AI-0200 (Ada 2012 feature) |
| 1201 |
|
| 1202 |
* *AI-0200 Mismatches in formal package declarations (0000-00-00)* |
| 1203 |
|
| 1204 |
This AI plugs a gap in the RM which appeared to allow some obviously intended |
| 1205 |
illegal instantiations. GNAT has never allowed these instantiations. |
| 1206 |
|
| 1207 |
RM References: 12.07 (16) |
| 1208 |
|
| 1209 |
.. index:: AI-0201 (Ada 2012 feature) |
| 1210 |
|
| 1211 |
* *AI-0201 Independence of atomic object components (2010-07-22)* |
| 1212 |
|
| 1213 |
If an Atomic object has a pragma ``Pack`` or a ``Component_Size`` |
| 1214 |
attribute, then individual components may not be addressable by independent |
| 1215 |
tasks. However, if the representation clause has no effect (is confirming), |
| 1216 |
then independence is not compromised. Furthermore, in GNAT, specification of |
| 1217 |
other appropriately addressable component sizes (e.g. 16 for 8-bit |
| 1218 |
characters) also preserves independence. GNAT now gives very clear warnings |
| 1219 |
both for the declaration of such a type, and for any assignment to its components. |
| 1220 |
|
| 1221 |
RM References: 9.10 (1/3) C.06 (22/2) C.06 (23/2) |
| 1222 |
|
| 1223 |
.. index:: AI-0203 (Ada 2012 feature) |
| 1224 |
|
| 1225 |
* *AI-0203 Extended return cannot be abstract (0000-00-00)* |
| 1226 |
|
| 1227 |
A return_subtype_indication cannot denote an abstract subtype. GNAT has never |
| 1228 |
permitted such usage. |
| 1229 |
|
| 1230 |
RM References: 3.09.03 (8/3) |
| 1231 |
|
| 1232 |
.. index:: AI-0205 (Ada 2012 feature) |
| 1233 |
|
| 1234 |
* *AI-0205 Extended return declares visible name (0000-00-00)* |
| 1235 |
|
| 1236 |
This AI corrects a simple omission in the RM. Return objects have always |
| 1237 |
been visible within an extended return statement. |
| 1238 |
|
| 1239 |
RM References: 8.03 (17) |
| 1240 |
|
| 1241 |
.. index:: AI-0206 (Ada 2012 feature) |
| 1242 |
|
| 1243 |
* *AI-0206 Remote types packages and preelaborate (2010-07-24)* |
| 1244 |
|
| 1245 |
Remote types packages are now allowed to depend on preelaborated packages. |
| 1246 |
This was formerly considered illegal. |
| 1247 |
|
| 1248 |
RM References: E.02.02 (6) |
| 1249 |
|
| 1250 |
.. index:: AI-0207 (Ada 2012 feature) |
| 1251 |
|
| 1252 |
* *AI-0207 Mode conformance and access constant (0000-00-00)* |
| 1253 |
|
| 1254 |
This AI confirms that access_to_constant indication must match for mode |
| 1255 |
conformance. This was implemented in GNAT when the qualifier was originally |
| 1256 |
introduced in Ada 2005. |
| 1257 |
|
| 1258 |
RM References: 6.03.01 (16/2) |
| 1259 |
|
| 1260 |
.. index:: AI-0208 (Ada 2012 feature) |
| 1261 |
|
| 1262 |
* *AI-0208 Characteristics of incomplete views (0000-00-00)* |
| 1263 |
|
| 1264 |
The wording in the Ada 2005 RM concerning characteristics of incomplete views |
| 1265 |
was incorrect and implied that some programs intended to be legal were now |
| 1266 |
illegal. GNAT had never considered such programs illegal, so it has always |
| 1267 |
implemented the intent of this AI. |
| 1268 |
|
| 1269 |
RM References: 3.10.01 (2.4/2) 3.10.01 (2.6/2) |
| 1270 |
|
| 1271 |
.. index:: AI-0210 (Ada 2012 feature) |
| 1272 |
|
| 1273 |
* *AI-0210 Correct Timing_Events metric (0000-00-00)* |
| 1274 |
|
| 1275 |
This is a documentation only issue regarding wording of metric requirements, |
| 1276 |
that does not affect the implementation of the compiler. |
| 1277 |
|
| 1278 |
RM References: D.15 (24/2) |
| 1279 |
|
| 1280 |
.. index:: AI-0211 (Ada 2012 feature) |
| 1281 |
|
| 1282 |
* *AI-0211 No_Relative_Delays forbids Set_Handler use (2010-07-09)* |
| 1283 |
|
| 1284 |
The restriction ``No_Relative_Delays`` forbids any calls to the subprogram |
| 1285 |
``Ada.Real_Time.Timing_Events.Set_Handler``. |
| 1286 |
|
| 1287 |
RM References: D.07 (5) D.07 (10/2) D.07 (10.4/2) D.07 (10.7/2) |
| 1288 |
|
| 1289 |
.. index:: AI-0214 (Ada 2012 feature) |
| 1290 |
|
| 1291 |
* *AI-0214 Defaulted discriminants for limited tagged (2010-10-01)* |
| 1292 |
|
| 1293 |
Ada 2012 relaxes the restriction that forbids discriminants of tagged types |
| 1294 |
to have default expressions by allowing them when the type is limited. It |
| 1295 |
is often useful to define a default value for a discriminant even though |
| 1296 |
it can't be changed by assignment. |
| 1297 |
|
| 1298 |
RM References: 3.07 (9.1/2) 3.07.02 (3) |
| 1299 |
|
| 1300 |
.. index:: AI-0216 (Ada 2012 feature) |
| 1301 |
|
| 1302 |
* *AI-0216 No_Task_Hierarchy forbids local tasks (0000-00-00)* |
| 1303 |
|
| 1304 |
It is clearly the intention that ``No_Task_Hierarchy`` is intended to |
| 1305 |
forbid tasks declared locally within subprograms, or functions returning task |
| 1306 |
objects, and that is the implementation that GNAT has always provided. |
| 1307 |
However the language in the RM was not sufficiently clear on this point. |
| 1308 |
Thus this is a documentation change in the RM only. |
| 1309 |
|
| 1310 |
RM References: D.07 (3/3) |
| 1311 |
|
| 1312 |
.. index:: AI-0219 (Ada 2012 feature) |
| 1313 |
|
| 1314 |
* *AI-0219 Pure permissions and limited parameters (2010-05-25)* |
| 1315 |
|
| 1316 |
This AI refines the rules for the cases with limited parameters which do not |
| 1317 |
allow the implementations to omit 'redundant'. GNAT now properly conforms |
| 1318 |
to the requirements of this binding interpretation. |
| 1319 |
|
| 1320 |
RM References: 10.02.01 (18/2) |
| 1321 |
|
| 1322 |
.. index:: AI-0220 (Ada 2012 feature) |
| 1323 |
|
| 1324 |
* *AI-0220 Needed components for aggregates (0000-00-00)* |
| 1325 |
|
| 1326 |
This AI addresses a wording problem in the RM that appears to permit some |
| 1327 |
complex cases of aggregates with nonstatic discriminants. GNAT has always |
| 1328 |
implemented the intended semantics. |
| 1329 |
|
| 1330 |
RM References: 4.03.01 (17) |