https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71592

鍾 <heresy-me at hotmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|WONTFIX                     |FIXED

--- Comment #5 from 鍾 <heresy-me at hotmail dot com> ---
full_assertion_declaration ::= assertion_directive assertion_declaration
assertion_directive ::= *$assertion|c$assertion|!$assertion
assertion_declaration ::= assertion_body{,assertion_body}
assertion_body ::= static_assertion|dynamic_assertion
static_assertion ::= static(compile_time_boolean_expression,[failure_message])
dynamic_assertion ::=
dynamic(execution_time_boolean_expression,[failure_message])
failure_message ::= static_fortran_string

the static assertion directives of procedure is not only work on current
compilation unit, but also work on any module(possibly). a procedure contain
static assertion directive of a module, its assertion can contained by the
modules' mod file. So any procedures use this module procedure will be checked
the assertions by the compiler on compile-time(not on execution-time).

the dynamic assertion isn't like the simple preprocess assertion. dynamic
assertion will generate some check code, but the check code is not expanded on
the body of procedures. it can be a independent code fraction, or inlined to
the procedure consumer, but never alter the execution code of called procedure.

Then, the assertion can added freely for the function when declaration or
implementation.

Reply via email to