In the below function x in the capture list of the inner lambda is deemed unknown. This is hopefully not standard compliant. In the draft document c3225, clause 5.1.2 paragraph 9 you can read:
The reaching scope of a local
lambda expression is the set of enclosing scopes up to and including the innermost enclosing function and
its parameters. [ Note: this reaching scope includes any intervening lambda-expressions.
This must mean that x should be visible when the inner lambda starts. And in paragraph 10:
The identifiers in a capture-list are looked up using the usual rules for unqualified name lookup (3.4.1); each
such lookup shall find a variable with automatic storage duration declared in the reaching scope of the local
Should mean that there is no special rules when checking for the names in the capture clause.