generics icon indicating copy to clipboard operation
generics copied to clipboard

Using a deferred-arg in a nested template REQUIRES statement

Open aury6623 opened this issue 1 year ago • 0 comments

This is an issue we discussed during today's meeting. See this example:

template tmpl{C}
    integer, constant :: C
    temlplate tmpl{T}
        requires my_rqmt{C, T}
    end template
end template

The REQUIRES statement "provides specifications of deferred arguments by associating them with the deferred arguments of a REQUIREMENT." Furthermore, "Each <deferred-const> shall appear in <deferred-arg-list> of the innermost scoping unit." (reworded in #119).

Both of these things indicate that C is not permitted in the requires statement. C is host-associated, so the requires statement can't provide specifications for it.

However, it might be really useful to be able to use C in that requires statement.

This issue also applies to deferred types or procedures, not just constants.

aury6623 avatar May 20 '24 21:05 aury6623