=========================
GNAT 23 NEW FEATURES LIST
=========================

Copyright (C) 2026, AdaCore

This file contains a complete list of new features in version 23 of GNAT. A
full description of all GNAT features can be found in the GNAT User's Guide
and GNAT Reference Manual.

An ISO date (YYYY-MM-DD) appears in parentheses after the description line.
This date shows the implementation date of the feature. Any 23.0w wavefront
subsequent to this date will contain the indicated feature, as will any
subsequent 23 or later release.

NF-19509 Remove dependency on System.Img_LLLI for 'Image (2025-02-06)

  The Image attribute directly applied to an attribute reference
  that yields Universal_Integer, like GNAT's attribute Enum_Rep, no
  longer creates a dependency on the System.Img_LLLI unit
  (s-imgllli.ads file).

NF-19056 Support for the mold linker (2022-04-20)

  The GNAT Pro toolchain for native Linux platforms now includes the
  mold linker, a fast, drop-in alternative for GNU ld and gold.
  See the GNAT User's Guide for Native Platforms for guidance on how
  to enable mold.

NF-TC09-027 Support for binding to network interface controller (2023-07-13)

  The new option Bind_To_Device has been added to Get_Socket_Option
  and Set_Socket_Option to control the NIC (Network Interface
  Controller) on which a socket must be bound.

NF-V901-006 gnatpp - call-threshold switch enhancement (2022-09-08)

  In gnatpp, the call-threshold switch now applies to generic
  instantiations. Therefore, when used with an instantiation of a
  generic package or subprogram, and when the number of actual
  parameters is greater than the specified value for the switch and
  there is at least one named parameter association, each parameter
  association will start on a new line.

NF-V405-022 gnatpp: support for square brackets in aggregates (2022-04-29)

  Gnatpp now supports the use of square brackets for delimiting
  array and container aggregates, a syntax extension added in Ada
  2022.

NF-V923-008 GNAT installed as root/root on Linux hosts (2022-11-16)

  The doinstall script, when run as root, now installs GNAT with
  owner=root, group=root instead of owner=1001, group=1001.

NF-V713-062 New gnatbind switch -k (2022-07-18)

  A new gnatbind switch -k is available and can be used to disable
  the effect of -F (do not check the elaboration flag when calling
  elaboration procedures) when using -n explicitly or implicitly
  (for example, via stand-alone libraries).

NF-V706-029 Simplified compile-time checks for composite casing (2022-08-09)

  The rules associated with the casing on a selector of a composite
  type (a GNAT-defined language extension typically enabled via the
  -gnatX compiler switch) are simplified, as an intermediate step on
  the path to more comprehensive checking. This simplified checking
  includes a requirement that a "when others =>" case alternative
  must always be present. It is anticipated that this rule will be
  relaxed at some point.

NF-V630-044 Improved documentation for validity checking (2022-08-18)

  Incorrect text has been corrected and some unclear text clarified
  in the "Validity Checking" section of the GNAT User's Guide.

NF-V525-051 Improved call-initialization of controlled objects (2022-05-26)

  Objects with a controlled component and that are initialized with
  the result of a function call no longer require a pair of
  intermediate calls to the Adjust and Finalize routines.

NF-V520-027 Improved object code for small string expressions (2022-05-30)

  The code generated by the compiler for small dynamic string
  concatenations, as well as if expressions involving small static
  strings, no longer requires dynamic stack allocation.

NF-V517-016 Subprogram names in JSON output (2022-05-17)

  The compiler now emits subprogram names in its JSON output when
  combining the -gnatdJ switch with -fdiagnostics-format=json.

NF-V513-009 Support for complex FP types with -fdump-ada-spec (2022-05-17)

  The C/C++ bindings generated by means of -fdump-ada-spec now
  support complex floating-point types (complex numbers in the
  mathematical sense).

NF-V506-041 Absolute paths in the compiler's JSON output (2022-05-07)

  When the -gnatef switch is used along with the -fdiagnostics-
  format=json switch, the compiler will now emit absolute file paths
  in the location fields of its JSON output.

NF-V503-023 No_Dependence restriction applies to code generation (2022-07-12)

  The implementation dependences on units of the runtime library
  created by the code generator are now flagged as violations of the
  No_Dependence restriction for these units.

NF-V427-025 New 'option' field in GNAT's JSON output (2022-04-28)

  The compiler's JSON output for errors and warnings now contains an
  additional field mentioning the option causing the message, if it
  exists.

NF-V425-019 New and more accurate tags for gnat warnings (2022-04-27)

  More GNAT warnings are now tagged with their corresponding
  switches. Some tags have been refined from -gnatwm to -gnatw.o, as
  -gnatw.o represents a more precise subset of warnings emitted by
  -gnatwm.

NF-V318-008 Empty constructors for functional containers (2022-04-19)

  Empty constructors are now available for functional containers,
  allowing explicit creation of an empty container, such as for an
  empty set, sequence, or map.

NF-V309-001 New library package supporting binary search (2022-03-25)

  A new package GNAT.Binary_Search has been added to the GNAT
  library, supporting binary search over a sorted array or array-
  like container.

NF-V307-002 Usage of section attribute with -fdump-ada-spec (2022-03-07)

  The generation of C/C++ bindings by means of -fdump-ada-spec now
  supports the "section" attribute of GNU C/C++ and translates it
  into the Linker_Section aspect.

NF-V303-046 More selective warnings given by code generator (2022-03-23)

  The warnings given by the code generator for Ada programs are now
  restricted by default to objects actually present in the source
  code, as opposed to objects generated by the compiler during its
  translation.

NF-V228-023 Improved optimization of "=" on bit-packed arrays (2022-04-11)

  Efficiency of "=" and "/=" is improved in some cases of bit-packed
  arrays.

NF-V223-068 Debugger allows context-sensitive completion in Ada (2022-03-01)

  When debugging Ada, the debugger now supports context-sensitive
  completion using the tab key. Field names of records are now
  completed based on the left-hand-side of the component selection,
  and attribute names are now completed.

NF-V222-006 New code generator for CCG (2022-09-09)

  GNAT Pro CCG now comes with a new C code generator that takes
  advantage of the GNAT LLVM technology to compile Ada code into
  LLVM bitcode, and then to compile the bitcode into low-level C.
  This technology change provides a more robust compiler as well as
  additional supported constructs. In particular, all forms of
  representation clauses, as well as functions returning nonstatic-
  sized objects, are now supported.

NF-V215-029 Improve efficiency of containers when checks are off (2022-04-07)

  This patch disables certain internal consistency checks in the
  containers packages when Container_Checks are suppressed.

NF-V210-040 Better warnings for unreferenced generic units (2022-02-11)

  The compiler now warns about generic subprogram units that appear
  in with_clauses but then are not referenced.

NF-V201-025 String Interpolation (2023-01-04)

  As a language extension (enabled by the -gnatX0 switch), initial
  support is provided for a special syntax for string literals
  supporting "string interpolation", allowing expressions to be
  given directly within a string literal, and the values of the
  expressions are "interpolated" directly into the value of the
  enclosing string at run time. The new syntax also supports
  inclusion of formatting characters such as tab and newline.

NF-V120-048 Warn on conditional expressions with unset objects (2022-01-26)

  The compiler now warns when an unset object is referenced
  immediately within a conditional expression.

NF-V111-037 More efficient elaboration of derived record types (2022-03-21)

  The object code generated by the compiler for the elaboration of
  derived discriminated record types is now more efficient when the
  parent type has a representation clause and default expressions
  for components.

NF-UC23-015 Bracketed aggregates as expression function results (2022-01-07)

  Compiling in -gnat2022 mode nows allows directly using aggregates
  with square brackets as the result of an expression function.

NF-UC13-012 Better detection of integer overflow (2022-01-20)

  The compiler detects more cases of integer overflows and issues
  warnings accordingly.

NF-UC09-007 Hardened Booleans (2022-02-09)

  The Ada and C compilers now allow hardened boolean types to be
  introduced, with user-chosen alternative internal representations
  for larger hamming distances, and validity checking at points of
  use. See the Security Hardening Features section of the GNAT
  Reference Manual.

NF-UC01-011 Keep register order in trace dump for zynqmp boards (2022-02-02)

  For zynqmp boards, in the case of synchronous exceptions, the
  register order present in the stack is now preserved in the trace
  dump.

NF-UB17-024 Warning for with of ancestor (2021-12-10)

  GNAT now warns if the name in a with clause denotes an ancestor of
  the current unit.

NF-UB09-023 Ada 2022 "[]" null array aggregates (2022-04-11)

  Support is added for Ada 2022's square-bracket aggregate syntax in
  the case of an empty aggregate of an array type, as in "X :
  Some_Unconstrained_Array_Subtype := [];".

NF-UB08-010 Ada 2022 features added to sets containers (2022-05-25)

  New Ada 2022 subprograms Has_Element, Element, Query_Element,
  Next, Tampering_With_Cursors_Prohibited, and Generic_Keys.Key,
  taking a Container parameter, are added to the sets packages in
  Ada.Containers.

NF-UB04-020 Control Flow Redundancy hardening (2022-02-17)

  The compiler can now be instructed to generate hardening code to
  take note of visited basic blocks while executing a subprogram,
  and to verify that the notes reflect a legitimate path in the
  control flow graph of a subprogram, guarding against various
  control flow attacks. See the Security Hardening Features section
  of the GNAT Reference Manual.

NF-UA11-002 New generic functions in System.Atomic_Primitives (2021-10-12)

  The System.Atomic_Primitives package now contains a generic
  version of its functions to be instantiated on modular types.

NF-UA09-008 Warning for null ranges (2021-12-10)

  GNAT now warns if you declare a subtype with a compile-time-known
  null range, as in "subtype Letter is 'z' .. 'a';".

NF-UA06-040 Warn on unused variable in quantified subexpression (2021-10-11)

  It is common that a quantified expression takes the form of a
  conjunction or disjunction. In such a case, it is expected that
  all conjuncts/disjuncts reference the quantified variable. Not
  doing so can be either the symptom of an error, or of a suboptimal
  expression, as that subexpression could be extracted from the
  quantified expression. This is beneficial for both execution
  (speed) and for proof (automation). A warning is now issued in
  such a case.

NF-UA05-029 Better error messages for dot notation in calls (2021-11-12)

  GNAT issues better error messages when dot notation is used
  incorrectly, whether it is because the prefix is a generic package
  (instead of an instantiation of the generic) or because the object
  is not tagged (but using -gnatX would make the use of dot notation
  legal).

NF-U916-043 Extend -gnatX support for casing on composite values (2021-10-20)

  GNAT supports case statements that case on composite values as a
  GNAT-defined language extension. Certain subcomponent types that
  were previously disallowed for such a composite type are now
  allowed, but subject to a restriction that the value of such a
  subcomponent can only be specified in a case choice via a "box"
  (<>) component value. This includes subcomponent types that are
  not discrete, record, or array types (for example, private types),
  subtypes that are subject to a nonstatic constraint or to a
  predicate, and subtypes of array types that have a nonstatic index
  subtype or that are multidimensional.

NF-U910-002 Hardened Conditionals (2021-10-30)

  The compiler can now be instructed to generate code to harden
  conditional branches and compares, guarding against hardware
  attacks such as power deprivation by introducing reversed compares
  that abort on unexpected results. See the Security Hardening
  Features section of the GNAT Reference Manual.

NF-U903-027 New warning on differing subtypes that fully conform (2021-10-12)

  A warning is now issued when a subprogram has corresponding formal
  parameter or result subtype_marks that fully conform between the
  subprogram's declaration and body but the denoted subtypes come
  from different subtype declarations. This warning is enabled with
  -gnatw_p, a new switch that is intended to cover "pedantic" checks
  (and which currently only includes this one check case).

NF-U706-034 Ada 2022 support for square brackets in aggregates (2021-11-25)

  The compiler, when compiling for Ada 2022 (for example, using
  -gnat2022), requires square brackets for container aggregates, and
  emits an error for parentheses. It now also emits a warning when
  parentheses are used for array aggregates, and an obsolescent-
  feature warning when such warnings are enabled (for example, with
  -gnatwj or -gnatwa).

NF-U611-048 Register and Stack Scrubbing (2021-10-30)

  The compiler can now be instructed to generate code to zero-out
  registers (that are not call-preserved) and stack frames when
  returning from subprograms. See the Security Hardening Features
  section of the GNAT Reference Manual.

NF-U611-008 New GNAT.Generic_Fast_Math_Functions unit (2022-03-31)

  The new GNAT.Generic_Fast_Math_Functions unit provides direct
  access to the underlying implementation of common mathematical
  functions, generally from the system mathematical library,
  including on x86-64/Linux to the vector implementation of the
  system mathematical library.

NF-U602-057 Support for shared libraries on aarch64-vx7r2 (2022-03-19)

  GNAT is now able to link rtp with shared libraries and to produce
  shared libraries for aarch64-vx7r2.

NF-U521-003 New restriction No_Tagged_Type_Registration (2021-12-04)

  A new restriction, No_Tagged_Type_Registration, is now supported
  that disallows use of class-wide streaming operations and
  operations in Ada.Tags. It also allows restriction
  No_Elaboration_Code in the presence of tagged types, which in turn
  allows the compiler to avoid elaboration code in some cases when
  pragma Elaborate_Body is also used.

NF-U504-045 Expression defaults for generic formal functions (2021-11-18)

  As a language extension, the default for a generic formal function
  can now be specified by an expression, using syntax analogous to
  an expression function (for example, "with function F (Obj : T)
  return T is (Obj)"). This feature is enabled by using the switch
  -gnatX or pragma Extensions_Allowed.

NF-U421-012 Better support for link-time optimization (2021-09-30)

  The declaration of some runtime symbols was changed in order to
  better support LTO.

NF-U419-034 Improve expected type error messages for subtypes (2022-02-17)

  The compiler now provides improved error messages concerning type
  mismatches, by directly printing in more cases a subtype name
  based on the context, instead of the name of the expected type's
  first subtype.

NF-U324-015 Linux runtime built with -fstack-clash-protection (2022-02-02)

  The GNAT runtime on Linux targets is now built with -fstack-clash-
  protection to prevent writing past the stack, as done on other
  libraries in recent Linux distributions.

NF-U107-024 Improve error messages to include full package names (2022-01-14)

  The compiler now provides improved error messages so that messages
  about adding missing with_clauses show the complete expanded
  package name instead of a limited number of selectors.

NF-TC15-091 Instance names added to non-visible error messages (2022-01-07)

  Messages are now improved for errors about non-visible
  declarations within generic instantiations, by including the name
  of the instantiation.

NF-TC07-012 Gprof support for x86_64-windows without -PIE (2022-11-17)

  Gprof is now supported on x86_64-windows. However, it requires
  programs to be compiled without PIE, which must be disabled by
  passing the -no-pie switch to the compiler.

NF-TA14-019 New restriction No_Local_Tagged_Types (2022-02-04)

  A new GNAT-specific restriction, No_Local_Tagged_Types, is now
  supported that only allows the declaration of tagged types at
  library level.

NF-T820-002 Enable lock-free protected implementation by default (2022-08-29)

  In the past, the Lock_Free aspect of a protected type (including
  an anonymous type) defaulted to False. In the case where an
  explicit "Lock_Free => True" aspect specification would be legal,
  the aspect now defaults to True; this means that a lock-free
  implementation is used to implement the type's protected
  operations. All support for the Lock_Free attribute (which should
  not be confused with the Lock_Free aspect) is removed.

NF-T409-002 Ada 2022: Entry family index in pre/postconditions (2022-04-05)

  Ada 2022 adds the Index attribute, which allows the use of the
  entry family index of an entry call within preconditions and
  postconditions. This feature is documented in AI12-0143.

NF-T327-005 Secondary stack allocations using overalignment (2022-06-16)

  Objects allocated on the secondary stack can now be aligned using
  values greater than 2 * Standard'Maximum_Alignment (or
  Standard'Maximum_Alignment when using zfp or cert runtimes) using
  an Alignment clause or aspect.

NF-SC04-017 Florist: Support for additional O_* flags (2022-03-17)

  The POSIX.C package has been enhanced to include additional flags
  (O_EXEC, O_SEARCH, O_CLOEXEC, O_DIRECTORY, O_NOFOLLOW and
  O_TTY_INIT). In addition, the POSIX.IO package has been enhanced
  to include new Open_Option_Set constants corresponding to
  O_CLOEXEC, O_DIRECTORY and O_NOFOLLOW.

NF-S821-017 Ada 2022: Class-wide types and formal subprograms (2021-10-19)

  Ada 2022 specifies that when the controlling type of a formal
  abstract subprogram declaration is a formal type, and the actual
  type is a class-wide type T'Class, the actual subprogram can be an
  implicitly declared subprogram corresponding to a primitive
  operation of type T. This feature is documented in AI12-0165-1.

NF-S318-087 Aggregate aspect for Ada.Containers.Ordered_Sets (2022-08-22)

  For any instance of the predefined generic package
  Ada.Containers.Ordered_Sets, Ada 2022 support is added for
  container aggregates of the type Set declared therein. More
  specifically, the Aggregate aspect_specification given in Ada 2022
  RM A.18.9 for the type Ada.Containers.Ordered_Sets was missing
  from the file a-coorse.ads and now it is present.

NF-RA02-062 New "task apply" command in debugger (2021-11-01)

  The debugger has a new command, "task apply". This is an Ada task
  analogue of the existing "thread apply" command.

NF-R831-011 No_Return accounted for in unreachable-code warnings (2022-06-24)

  The compiler now accounts for pragma No_Return in determining
  unreachable code. This causes some false-alarm warnings to
  disappear (for example, warnings about out-of-range values in
  unreachable code). This also results in some new warnings about
  unreachable code.

NF-R822-029 Florist: Error handling during child creation (2022-03-16)

  A new optional parameter called On_Child_Failure has been added to
  the Start_Process and Start_Process_Search procedures in Florist.
  This parameter, when not null, is an access to a procedure that is
  called when an error occurs in a child process during the process
  creation. This designated procedure can then be used to provide
  adequate handling of such errors before the child process
  terminates itself.

NF-QB06-016 Improved function returns for controlled components (2022-04-11)

  Functions whose result type is a composite type containing a
  controlled subcomponent no longer return on the secondary stack.

NF-QA03-052 New gnatcheck rules related to generics (2022-02-01)

  The following two new gnatcheck rules are available:
   - Too_Many_Generic_Dependencies: Flag each generic unit in a with
     clause that depends on a chain of more than N generic library
     units.
   - Deeply_Nested_Instantiations: Flag each generic instantiation
     containing a chain of nested generic instantiations in the
     specification part exceeding a given threshold.

NF-P916-004 Florist: combined shared and static libraries (2022-01-20)

  Configuring Florist with --enable-shared now builds both shared
  and static libraries.

NF-L426-033 Improved function returns for tagged types (2022-05-19)

  Functions whose result type is a tagged type, including a
  controlled type, no longer return on the secondary stack if the
  call is not dispatching on result.

NF-JA26-030 Debugger allows specifying bits of float literals (2022-02-24)

  The debugger now has a syntax extension to allow the exact bits of
  a floating-point literal to be specified in an expression.

NF-F821-006 Debugger support for non-ASCII identifiers (2022-02-23)

  The debugger now supports non-ASCII identifiers in the program
  being debugged.
