Dangling reference in inner lambda : <p>I have an inner lambda that uses one of the referenced variables of the outer lambda like this:</p>

<pre><code>int x=0;
auto outer=[&amp;](){
   return [&amp;](){
        x=5;
    };
};

auto inner= outer();
inner();
std::cout &lt;&lt; x;
</code></pre>

<p>I <a href="http://cpp.sh/9gv3a" rel="noreferrer">tried</a> it. It worked well. However, I want to make sure that there is no dangling reference here. Is there?</p>
