A metadirective is a directive that can specify multiple directive variants of which one may be conditionally selected to replace the metadirective based on the enclosing OpenMP context. A metadirective is replaced by a nothing directive or one of the directive variants specified by the when clauses or the otherwise clause. If no otherwise clause is specified the effect is as if one was specified without an associated directive variant.
The OpenMP context for a given metadirective is defined according to Section 7.1. The order of clauses that appear on a metadirective is significant and otherwise must be the last clause specified on a metadirective.
Replacement candidates are ordered according to the following rules in decreasing precedence:
The list of dynamic replacement candidates is the prefix of the sorted list of replacement candidates up to and including the first candidate for which the corresponding when clause has a static context selector. The first dynamic replacement candidate for which the corresponding when clause has a compatible context selector, according to the matching rules defined in Section 7.3, replaces the metadirective.
Restrictions
Restrictions to metadirectives are as follows:All items must be executable directives if the first dynamic replacement candidate does not have a static context selector.