File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -83,3 +83,21 @@ enum VerifyConstraintResult {
8383};
8484
8585//===---------------------------------------------------------------------===//
86+
87+ Blocks should not capture variables that are only used in dead code.
88+
89+ The rule that we came up with is that blocks are required to capture
90+ variables if they're referenced in evaluated code, even if that code
91+ doesn't actually rely on the value of the captured variable.
92+
93+ For example, this requires a capture:
94+ (void) var;
95+ But this does not:
96+ if (false) puts(var);
97+
98+ Summary of <rdar://problem/9851835>: if we implement this, we should
99+ warn about non-POD variables that are referenced but not captured, but
100+ only if the non-reachability is not due to macro or template
101+ metaprogramming.
102+
103+ //===---------------------------------------------------------------------===//
You can’t perform that action at this time.
0 commit comments