https://gcc.gnu.org/bugzilla/show_bug.cgi?id=129272
--- Comment #14 from Harald Anlauf <anlauf at gcc dot gnu.org> ---
The F2018 meta-bug is PR85836.
The question how the STAT= and ERRMSG= arguments are treated is answered in
J3/18-007r1:
19.6.5 Events that cause variables to become defined
Variables become defined by the following events.
[...]
(16) Execution of a statement with a STAT= specifier causes the variable
specified by the STAT= specifier to become defined.
(17) If an error condition occurs during execution of a statement that has an
ERRMSG= specifier, the variable specified by the ERRMSG= specifier becomes
defined.