You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -664,6 +664,12 @@ The use of conditional methods in an inheritance chain can be confusing. Calls m
664
664
>
665
665
> *end example*
666
666
667
+
#### §conditional-local-function Conditional local functions
668
+
669
+
A local function may be made conditional in the same sense as a conditional method ([§23.5.3.2](attributes.md#23532-conditional-methods)).
670
+
671
+
A conditional local function shall have the modifier `static`.
672
+
667
673
#### 23.5.3.3 Conditional attribute classes
668
674
669
675
An attribute class ([§23.2](attributes.md#232-attribute-classes)) decorated with one or more `Conditional` attributes is a conditional attribute class. A conditional attribute classis thus associated with the conditional compilation symbols declared in its `Conditional` attributes.
A*local_function_body*or*ref_local_function_body*shallbeasemicolononlyfor an external local function.
566
573
567
574
A local function is declared at block scope. A non-static local function may capture variables from the enclosing scope while a static local function shall not (so it has no access to enclosinglocals, parameters, non-staticlocalfunctions, or `this`). Itisacompile-timeerrorifacapturedvariableisreadbythebodyofanon-staticlocalfunctionbutisnotdefinitelyassignedbeforeeachcalltothefunction. Acompilershalldeterminewhichvariablesaredefinitelyassignedonreturn ([§9.4.4.33](variables.md#94433-rules-for-variables-in-local-functions)).
0 commit comments