Here, deciding whether the nested lambda was dependent meant checking the enclosing function, which meant checking the function's type, which meant checking its return type, the nested lambda. I've broken this cycle by looking not at whether the enclosing function is a dependent expression, but whether it is a template. Tested x86_64-pc-linux-gnu, applying to trunk.