I\'ve been writing code, and I\'ve recently found out that g++ doesn\'t warn me about a certain class of issue: per C++11 5.1.2.4, if your lambda is not a single return stat
That is because it is a defect in the standard, and will be changed (see DR 975):
975 Restrictions on return type deduction for lambdas
There does not appear to be any technical difficulty that would require the current restriction that the return type of a lambda can be deduced only if the body of the lambda consists of a single return statement. In particular, multiple return statements could be permitted if they all return the same type.
I doubt if there is a way to turn it off.