A point from n3290:ISO Standared draft, §5.1.2/9
A lambda-expression whose smallest enclosing scope is a block scope (3.3.3)
is a local lambda expression; any other lambda-expression shall not have a
capture-list in its lambda-introducer. 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-expression‘s — end note ]
Can any one give an exmaple for the above point, especially: “other lambda-expression shall not have a capture-list in its lambda-introducer.”
Where does this situation arise?
The situation should theoretically arise in namespace scope, as @Space_C0wb0y shows in his comment link.
If find it strange that GCC accepts that snippet, as MSVC correctly rejects it with the following error message: